using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Globalization;
using System.Threading;
using System.Reflection;
using System.Resources;
/****************************************************************************************************************************
* Project Name    : TimeCheck                              Started Date  : 12-Aug-2007
* Module          : Permission Sanction                    Last Modified : 14-Aug-2007
* Programmer      : Prabakaran.P
* Current Storage : \\Angler56\Projects\Inprogress\SCREEN1206\code\Time_AttendanceApp
* BackUp          :
****************************************************************************************************************************/
public partial class Transactions_TA_UI_Transactions_PermissionSanction_Angler : Base.BasePage
{
    ResourceManager rm;
    CultureInfo ci;
    Cls_CheckUser objCheckUser = new Cls_CheckUser();
    DataSet ds_Checkuser = new DataSet();
    //Cls_Connect cl = new Cls_Connect();
    LeaveApplicationEventData_Angler objLeaveApplicationEventData = new LeaveApplicationEventData_Angler();
    cls_Common objClassCommon = new cls_Common();
    DateTime CurrentDate;
    int month;
    int year;
    int date;
    int TotalDays;
    DataSet dsEmployeeGroup = new DataSet();
    string gstrDateFormat, strFromDateTime, strToDateTime;
    protected override void Page_Load(object sender, EventArgs e)
    {
        // session checking
        base.Page_Load(sender, e);
        ////if Standar Edition set the visibility to false
        //if (Session["Edition"].ToString() == "1")
        //{
        //    Response.Redirect("TransactionLandingPage.aspx");
        //}
        if (!Page.IsPostBack)
        {
            base.CheckPages(0);
            objClassCommon.menu("PermissionTransaction", "261");
            Hidden1.Value = Session["IDateFormat"].ToString();
        }
        //get the culture info to set the language
        string source_Language;
        source_Language = Session["Session_ActiveLanguage"].ToString();
        rm = new ResourceManager(source_Language, System.Reflection.Assembly.Load("App_GlobalResources"));
        ci = Thread.CurrentThread.CurrentCulture;
        LoadStrings(ci);
        //Set UserRights
        UserRights();
        string strSetAlert = "";
        strSetAlert = strSetAlert + "<script language='javascript'>";
        strSetAlert = strSetAlert + "SetAlertMessages('" + rm.GetString("Alert_EnterDate", ci) + "','" + rm.GetString("Alert_EnterToDate", ci) + "','" + rm.GetString("Alert_SelectStatus", ci) + "');";
        strSetAlert = strSetAlert + "SetAlertCheckDate('" + rm.GetString("Alert_Validmonthdatefourdigit", ci) + "','" + rm.GetString("Alert_Validdatemonthfourdigit", ci) + "','" + rm.GetString("Alert_Invalidyearentry", ci) + "','" + rm.GetString("Alert_Invalidmonthentry", ci) + "','" + rm.GetString("Alert_Invaliddateentry", ci) + "','" + rm.GetString("Alert_IncorrectdateformatDDMONYYYY", ci) + "','" + rm.GetString("Alert_Entertime", ci) + "','" + rm.GetString("Alert_Invalidvalueforhours", ci) + "','" + rm.GetString("Alert_Invalidvalueforminites", ci) + "','" + rm.GetString("Alert_Invalidtimeformat1", ci) + "','" + rm.GetString("Alert_PleaseentervalidDateandTime", ci) + "','" + rm.GetString("Alert_ValiddatemonthMMDDYYHHMM", ci) + "','" + rm.GetString("Alert_ValiddatemonthMMDDYYHHMMTT") + "','" + rm.GetString("Alert_PleaseentervalidDateandTime", ci) + "','" + rm.GetString("Alert_Invalidvalueforhours", ci) + "','" + rm.GetString("Alert_Invalidvalueforminites", ci) + "');";
        strSetAlert = strSetAlert + "</script>";
        Page.RegisterStartupScript("SetAlertMessages", strSetAlert);
        if (!IsPostBack)
        {
            //ddlStatus.Items.Clear();
            //ddlStatus.Items.Insert(0, "-Select Status-");
            DataSet ds_RecordsCountLeaveReportingTo = new DataSet();
            ds_RecordsCountLeaveReportingTo = objLeaveApplicationEventData.GetRecordsCountLeaveReportingTo(Convert.ToInt32(Session["EmpAutoId"]));
            if (Convert.ToInt32(ds_RecordsCountLeaveReportingTo.Tables[0].Rows[0]["RecordsCount"]) > 0)
            {
                //ddlStatus.Items.Clear();
                //ddlStatus.Items.Insert(0, "-Select Status-");
                //ddlStatus.Items.Insert(1, "Forwarded");
                //ddlStatus.Items.Insert(2, "Pending");
                //ddlStatus.Items.Insert(3, "Rejected");
                //ddlStatus.Items.Insert(4, "Resend");
                //ddlStatus.Items.Insert(5, "Reply");
                //ddlStatus.Items.Clear();
                //ddlStatus.Items.Insert(0, "-Select Status-");
                //ddlStatus.Items.Insert(1, "All");
                //ddlStatus.Items.Insert(2, "Approved");
                //ddlStatus.Items.Insert(3, "Forwarded");
                //ddlStatus.Items.Insert(4, "Pending");
                //ddlStatus.Items.Insert(5, "Rejected");
                //ddlStatus.Items.Insert(6, "Resend");
                //ddlStatus.Items.Insert(7, "Reply");
            }
            DataSet dsRecordsCount = new DataSet();
            //SqlParameter pEmpId = new SqlParameter("@Employee_Id", Convert.ToInt32(Session["EmpAutoId"]));
            //SqlParameter[] pParams ={ pEmpId };
            //dsRecordsCount = cl.fillDs_SP("Proc_TA_GetRecordsCountLeaveSanction", pParams);
            dsRecordsCount = objLeaveApplicationEventData.GetRecordsCountLeaveSanction(Convert.ToInt32(Session["EmpAutoId"]));
            if (Convert.ToInt32(dsRecordsCount.Tables[0].Rows[0]["RecordsCount"]) > 0)
            {
                //ddlStatus.Items.Clear();
                //ddlStatus.Items.Insert(0, "-Select Status-");
                //ddlStatus.Items.Insert(1, "Approved");
                //ddlStatus.Items.Insert(2, "Forwarded");
                //ddlStatus.Items.Insert(3, "Rejected");
                //ddlStatus.Items.Insert(4, "Resend");
                //ddlStatus.Items.Insert(5, "Reply");
                //ddlStatus.Items.Clear();
                //ddlStatus.Items.Insert(0, "-Select Status-");
                //ddlStatus.Items.Insert(1, "All");
                //ddlStatus.Items.Insert(2, "Approved");
                //ddlStatus.Items.Insert(3, "Forwarded");
                //ddlStatus.Items.Insert(4, "Pending");
                //ddlStatus.Items.Insert(5, "Rejected");
                //ddlStatus.Items.Insert(6, "Resend");
                //ddlStatus.Items.Insert(7, "Reply");
            }
            if (Session["UserGroupName"].ToString() == "SuperAdmin" || Session["HasSpecialRights"].ToString() == "True")
            {
                //ddlStatus.Items.Clear();
                //ddlStatus.Items.Insert(0, "-Select Status-");
                //ddlStatus.Items.Insert(1, "All");
                //ddlStatus.Items.Insert(2, "Approved");
                //ddlStatus.Items.Insert(3, "Forwarded");
                //ddlStatus.Items.Insert(4, "Pending");
                //ddlStatus.Items.Insert(5, "Rejected");
                //ddlStatus.Items.Insert(6, "Resend");
                //ddlStatus.Items.Insert(7, "Reply");
            }
            #region Comments
            //ddlStatus.Items.Clear();
            //ddlStatus.Items.Insert(0, "-Select Status-");
            /// <summary>
            /// commented on feb-16-2012
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            ////if (Session["UserGroupName"].ToString() == "SuperAdmin" || Session["HasSpecialRights"].ToString() == "True")
            ////{
            ////    //ddlStatus.Items.Clear();
            ////    //ddlStatus.Items.Insert(0, "-Select Status-");
            ////    //ddlStatus.Items.Insert(1, "All");
            ////    //ddlStatus.Items.Insert(2, "Approved");
            ////    //ddlStatus.Items.Insert(3, "Forwarded");
            ////    //ddlStatus.Items.Insert(4, "Pending");
            ////    //ddlStatus.Items.Insert(5, "Rejected");
            ////}
            ////else
            ////{
            ////    DataSet ds_RecordsCountLeaveReportingTo = new DataSet();
            ////    ds_RecordsCountLeaveReportingTo = objLeaveApplicationEventData.GetRecordsCountLeaveReportingTo(Convert.ToInt32(Session["EmpAutoId"]));
            ////    DataSet dsRecordsCount = new DataSet();
            ////    dsRecordsCount = objLeaveApplicationEventData.GetRecordsCountLeaveSanction(Convert.ToInt32(Session["EmpAutoId"]));
            ////    if ((Convert.ToInt32(ds_RecordsCountLeaveReportingTo.Tables[0].Rows[0]["RecordsCount"]) > 0) && (Convert.ToInt32(dsRecordsCount.Tables[0].Rows[0]["RecordsCount"]) > 0))
            ////    {
            ////    }              
            ////    else if (Convert.ToInt32(dsRecordsCount.Tables[0].Rows[0]["RecordsCount"]) > 0)
            ////    {
            ////        //ddlStatus.Items.Clear();
            ////        //ddlStatus.Items.Insert(0, "-Select Status-");
            ////        //ddlStatus.Items.Insert(1, "Approved");
            ////        //ddlStatus.Items.Insert(2, "Forwarded");
            ////        //ddlStatus.Items.Insert(3, "Rejected");
            ////        ddlStatus.Items[1].Enabled = false;
            ////        ddlStatus.Items[4].Enabled = false;
            ////    }
            ////    else if (Convert.ToInt32(ds_RecordsCountLeaveReportingTo.Tables[0].Rows[0]["RecordsCount"]) > 0)
            ////    {
            ////        //ddlStatus.Items.Clear();
            ////        //ddlStatus.Items.Insert(0, "-Select Status-");
            ////        //ddlStatus.Items.Insert(1, "Forwarded");
            ////        //ddlStatus.Items.Insert(2, "Pending");
            ////        //ddlStatus.Items.Insert(3, "Rejected");
            ////        //ddlStatus.Items[0].Enabled = false;
            ////        ddlStatus.Items[1].Enabled = false;
            ////        ddlStatus.Items[2].Enabled = false;
            ////        ddlStatus.Items[3].Enabled = false;
            ////    }
            ////}
            //dsEmployeeGroup = objLeaveApplicationEventData.GetEmployeeGroupName(Convert.ToInt32(Session["EmpAutoId"]));
            //if (dsEmployeeGroup.Tables[0].Rows.Count > 0)
            //{
            //    if (dsEmployeeGroup.Tables[0].Rows[0]["GroupName"].ToString() == "SuperAdmin")
            //    {
            //        ddlStatus.Items.Clear();
            //        ddlStatus.Items.Insert(0, "-Select Status-");
            //        ddlStatus.Items.Insert(1, "All");
            //        ddlStatus.Items.Insert(2, "Approved");
            //        ddlStatus.Items.Insert(3, "Forwarded");
            //        ddlStatus.Items.Insert(4, "Pending");
            //        ddlStatus.Items.Insert(5, "Rejected");
            //    }
            //}
            #endregion
            // Alert Message 28-1-2011            
            txtFromDate.Text = (Convert.ToDateTime(CurrentMonthStartDate().ToString())).ToString(Session["MDateFormat"].ToString());
            txtToDate.Text = (Convert.ToDateTime(NextMonthEndDate())).ToString(Session["MDateFormat"].ToString());
        }
    }
    public DateTime CurrentMonthStartDate()
    {
        CurrentDate = (DateTime.Now);
        CurrentDate = CurrentDate.AddDays(-(CurrentDate.AddDays(-1).Day));
        CurrentDate = CurrentDate.AddMonths(-1);
        return CurrentDate;
    }
    public DateTime NextMonthEndDate()
    {
        CurrentDate = (DateTime.Now);
        CurrentDate = CurrentDate.AddMonths(1);
        month = CurrentDate.Month;
        year = CurrentDate.Year;
        TotalDays = System.DateTime.DaysInMonth(year, month);
        date = CurrentDate.Day;
        date = TotalDays - date;
        CurrentDate = CurrentDate.AddDays(date);
        return CurrentDate;
    }
    public void CompareDate(object s, ServerValidateEventArgs e)
    {
        try
        {
            //Convert Date Format to MM/dd/yyyy Format
            gstrDateFormat = Convert.ToString(Session["MDateFormat"]);
            // strApplicationDate = objClassCommon.DateConvertion(gstrDateFormat, TxtPermissionDate.Text);
            //Convert Date Format to MM/dd/yyyy Format
            strFromDateTime = objClassCommon.DateTimeConvertion((gstrDateFormat), txtFromDate.Text, "D");
            strToDateTime = objClassCommon.DateTimeConvertion((gstrDateFormat), txtToDate.Text, "D");
            DateTime dtToDate = DateTime.Parse(strToDateTime);
            DateTime dtFromDate = DateTime.Parse(strFromDateTime);
            TimeSpan diff = dtToDate.Subtract(dtFromDate);
            int day = diff.Days;
            if (day >= 0)
            {
                e.IsValid = true;
            }
            else
            {
                base.Message(rm.GetString("Msg_GrearterThanFrmDate", ci));
                e.IsValid = false;
            }
        }
        catch
        {
            //
        }
    }
    //Compare FromMonth With Current Month
    public void CompareCurrentdate(object s, ServerValidateEventArgs e)
    {
        //try
        //{
        //    //Convert Date Format to MM/dd/yyyy Format
        //    gstrDateFormat = Convert.ToString(Session["MDateFormat"]);
        //    // strApplicationDate = objClassCommon.DateConvertion(gstrDateFormat, TxtPermissionDate.Text);
        //    //Convert Date Format to MM/dd/yyyy Format
        //    strFromDateTime = objClassCommon.DateTimeConvertion((gstrDateFormat), txtFromDate.Text, "D");
        //    DateTime dtCurrentDate = DateTime.Now;
        //    DateTime dtFromDate = DateTime.Parse(strFromDateTime);
        //    TimeSpan diff = dtFromDate.Subtract(dtCurrentDate);
        //    int day = diff.Days;
        //    if (day >= 0)
        //        e.IsValid = true;
        //    else
        //        e.IsValid = false;
        //}
        //catch
        //{
        //    //
        //}
    }
    //Compare Tomonth with Current Month
    public void CompareTodate(object s, ServerValidateEventArgs e)
    {
        //try
        //{
        //    //Convert Date Format to MM/dd/yyyy Format
        //    gstrDateFormat = Convert.ToString(Session["MDateFormat"]);
        //    strToDateTime = objClassCommon.DateTimeConvertion((gstrDateFormat), txtToDate.Text, "D");
        //    DateTime dtCurrentDate = DateTime.Now;
        //    DateTime dtFromDate = DateTime.Parse(strToDateTime);
        //    TimeSpan diff = dtFromDate.Subtract(dtCurrentDate);
        //    int day = diff.Days;
        //    if (day >= 0)
        //        e.IsValid = true;
        //    else
        //        e.IsValid = false;
        //}
        //catch
        //{
        //    //
        //}
    }
    protected void btn_View_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            //Response.Write(Convert.ToInt32(Session["parentLevelId"]));
            int LevelId = Convert.ToInt32(Session["parentLevelId"]);
            string strScript = string.Empty;
            int intCompanyId;
            string strStatus = string.Empty;
            string strModule = string.Empty;
            string strSwipeCardNo = string.Empty;
            string strEmployeeName = string.Empty;
            string strEmployeeCodeId = string.Empty;
           // Session["PermissionSanctionStatus"] = ddlStatus.SelectedItem.Text.ToString();
            strSwipeCardNo = txtSwipeCard.Text;
            strEmployeeName = txt_EmpName.Text.Trim().Replace("'", "''");
            strEmployeeCodeId = txtEmployeeId.Text.Trim().Replace("'", "''");
            strScript = "";
            strScript = strScript + "<script language='javascript'>";
            bool blnParentExists = true;
            strModule = "PermissionSanction";
            if (Session["parentLevelId"] == null)
            {
                blnParentExists = false;
            }
            else if (Convert.ToInt32(Session["parentLevelId"]) == 0)
            {
                blnParentExists = false;
            }
            if (blnParentExists == false)
            {
                strScript = strScript + "alert('" + rm.GetString("Alert_SelectCompany", ci) + "');";
                strScript = strScript + "</script>";
                Page.RegisterStartupScript("AlertManualApproval", strScript);
                return;
            }
            intCompanyId = getParentCompany(Convert.ToInt32(Session["parentLevelId"]));
            strStatus = GetApprovalStatus(intCompanyId, strModule);
            if (strStatus == "ApprovalNotRequired")
            {
                //lblApprovalStatus.Text = "Approval Not Required for this company";
                strScript = strScript + "alert('" + rm.GetString("Alert_ApprovalNotRequiredforthiscompany", ci) + "');";
                strScript = strScript + "</script>";
                Page.RegisterStartupScript("AlertManualApproval", strScript);
                return;
            }
            else if (strStatus == "ApprovalRequired")
            {
                //continue
            }
            else if (strStatus == "NotDefined")
            {
                //lblApprovalStatus.Text = "Approval Settings not defined for this company";
                strScript = strScript + "alert('" + rm.GetString("Alert_ApprovalSettingsnotdefinedforthiscompany", ci) + "');";
                strScript = strScript + "</script>";
                Page.RegisterStartupScript("AlertManualApproval", strScript);
                return;
            }
            //Commeneted by Manjula.P on 21-Apr-2014 for ANGLER Development
            string strStatus1 = "";
            strStatus1 = CbApproved.Checked == true ? "Approved," : strStatus1;
            strStatus1 = CBPending.Checked == true ? strStatus1 + "Pending," : strStatus1;
            strStatus1 = CBResend.Checked == true ? strStatus1 + "Resend," : strStatus1;
            strStatus1 = CBForwarded.Checked == true ? strStatus1 + "Forwarded," : strStatus1;
            strStatus1 = CBRejected.Checked == true ? strStatus1 + "Rejected," : strStatus1;
            strStatus1 = CBReply.Checked == true ? strStatus1 + "Reply," : strStatus1;
            strStatus1 = strStatus1.Length > 0 ? strStatus1.Substring(0, strStatus1.Length - 1) : strStatus1;
            strStatus1 = strStatus1 == "" ? "Approved,Pending,Resend,Forwarded,Rejected,Reply" : strStatus1;
            //Addeed by Manjula.P on 21-Apr-2014 for getting checkbox status for ANGLER development
            Session["PermissionSanctionStatus"] = strStatus1;
            // Response.Redirect("../Transactions/TA_UI_Transactions_PermissionSanctionView.aspx?LevelId=" + LevelId + "&Status=" + ddlStatus.SelectedValue + "&From_Date=" + txtFromDate.Text + "&To_Date=" + txtToDate.Text + "&strSwipeCardNo=" + strSwipeCardNo + "&strEmployeeName=" + strEmployeeName + "&strEmployeeCodeId=" + strEmployeeCodeId);
            if (strStatus1 == "Forwarded" || strStatus1 == "Pending")
            {
                Response.Redirect("../Transactions/TA_UI_Transactions_PermissionBulkSanction_Angler.aspx?LevelId=" + LevelId + "&Status=" + strStatus1 + "&From_Date=" + txtFromDate.Text + "&To_Date=" + txtToDate.Text + "&strSwipeCardNo=" + strSwipeCardNo + "&strEmployeeName=" + strEmployeeName + "&strEmployeeCodeId=" + strEmployeeCodeId);
            }
            else
            {
                Response.Redirect("../Transactions/TA_UI_Transactions_PermissionSanctionView_Angler.aspx?LevelId=" + LevelId + "&Status=" + strStatus1 + "&From_Date=" + txtFromDate.Text + "&To_Date=" + txtToDate.Text + "&strSwipeCardNo=" + strSwipeCardNo + "&strEmployeeName=" + strEmployeeName + "&strEmployeeCodeId=" + strEmployeeCodeId);
            }
            #region Comments from Product
            // if (ddlStatus.SelectedItem.Text == rm.GetString("btn_Forwarded", ci) || ddlStatus.SelectedItem.Text == rm.GetString("btn_Pending", ci))
            //{
            // Response.Redirect("../Transactions/TA_UI_Transactions_PermissionBulkSanction.aspx?LevelId=" + LevelId + "&Status=" + ddlStatus.SelectedItem.Text.ToString() + "&From_Date=" + txtFromDate.Text + "&To_Date=" + txtToDate.Text + "&strSwipeCardNo=" + strSwipeCardNo + "&strEmployeeName=" + strEmployeeName + "&strEmployeeCodeId=" + strEmployeeCodeId);
            //}
            // else
            //{
            //Response.Redirect("../Transactions/TA_UI_Transactions_PermissionSanctionView.aspx?LevelId=" + LevelId + "&Status=" + ddlStatus.SelectedItem.Text.ToString() + "&From_Date=" + txtFromDate.Text + "&To_Date=" + txtToDate.Text + "&strSwipeCardNo=" + strSwipeCardNo + "&strEmployeeName=" + strEmployeeName + "&strEmployeeCodeId=" + strEmployeeCodeId);
            // }
            #endregion
        }
    }
    public int getParentCompany(int iEmployeeLevelID)
    {
        //Select Company
        org_levelsEventData getOrg = new org_levelsEventData();
        getOrg.GetOrgParentLevels_FromID(iEmployeeLevelID);
        DataSet ds_getOrg = new DataSet();
        ds_getOrg = getOrg.GetOrgParentLevels();
        int iCompanyID = 0;
        if (ds_getOrg != null)
        {
            if (ds_getOrg.Tables[0].Rows.Count > 0)
            {
                iCompanyID = Convert.ToInt32(ds_getOrg.Tables[0].Rows[0]["LevelID"].ToString());
            }
        }
        return iCompanyID;
    }
    public string GetApprovalStatus(int intCompanyId, string strModule)
    {
        int approvalSettingsPageExists = 0;
		//Checking grade module is available or not and changed the id value from 110 to 228
        approvalSettingsPageExists = objClassCommon.CheckPageExistsInLicense(228);
        string strStatus = string.Empty;
        if (approvalSettingsPageExists == 1)
        {
            //Get Approval Settings Based on Company Id
            DataSet dsApprovalSettings = new DataSet();
            ShiftEvenData objShift = new ShiftEvenData();
            dsApprovalSettings = objShift.SelectApprovalSettings(intCompanyId);
            if (dsApprovalSettings != null)
            {
                if (dsApprovalSettings.Tables.Count > 0)
                {
                    if (dsApprovalSettings.Tables[0].Rows.Count > 0)
                    {
                        if (Convert.ToBoolean(dsApprovalSettings.Tables[0].Rows[0][strModule]) == false)
                        {
                            strStatus = "ApprovalNotRequired";
                        }
                        else
                        {
                            strStatus = "ApprovalRequired";
                        }
                    }
                    else
                    {
                        strStatus = "NotDefined";
                    }
                }
            }
        }
        else
        {
            strStatus = "ApprovalRequired";
        }
        return strStatus;
    }
    //Getting Information from resource file and display it in label
    private void LoadStrings(CultureInfo ci)
    {
        lbl_Header.Text = rm.GetString("Transaction_PermissionSanction_PermissionSanction", ci);
        lbl_From.Text = rm.GetString("email_FromDate", ci);
        lbl_Status.Text = rm.GetString("email_Status", ci);
        lbl_To.Text = rm.GetString("email_ToDate", ci);
        //CustomValidator1.ErrorMessage = rm.GetString("Alert_SelectvalidFromDate", ci);
        //CustomValidator2.ErrorMessage = rm.GetString("Alert_SelectvalidToDate", ci);
        cus_ComDate.ErrorMessage = rm.GetString("Msg_GrearterThanFrmDate", ci);
        lbl_IndicatesMandatoryFields.Text = rm.GetString("IndicatesMandatoryFields", ci);
        btn_View.Text = "&nbsp;&nbsp;" + rm.GetString("btn_View", ci);
        lbl_EmployeeName.Text = rm.GetString("email_EmployeeName", ci);
        lbl_EmployeeId.Text = rm.GetString("email_EmployeeId", ci);
        lblEmpSwipe.Text = rm.GetString("TerminalDataType_Card_No", ci);
        //ddlStatus.Items[0].Text = rm.GetString("Select", ci);
        //ddlStatus.Items[0].Text = rm.GetString("ExportData_All", ci);
        //ddlStatus.Items[1].Text = rm.GetString("btn_Approved", ci);
        //ddlStatus.Items[2].Text = rm.GetString("btn_Forwarded", ci);
        //ddlStatus.Items[3].Text = rm.GetString("btn_Pending", ci);
        //ddlStatus.Items[4].Text = rm.GetString("btn_Reject", ci);
        //Getting Status for checkbox by Manjula.P on 21-Apr-2014
        //cbAll.Text = rm.GetString("ExportData_All", ci);
        //CbApproved.Text = rm.GetString("btn_Approved", ci);
        //CBForwarded.Text = rm.GetString("btn_Forwarded", ci);
        //CBPending.Text = rm.GetString("btn_Pending", ci);
        //CBRejected.Text = rm.GetString("btn_Reject", ci);
        //CBResend.Text = rm.GetString("Sanction_Resend", ci);
        //CBReply.Text = rm.GetString("Sanction_Reply", ci);
    }
    private void UserRights()
    {
        ds_Checkuser = objCheckUser.checkRights(261, Convert.ToInt32(Session["userGroup_Id"]), "viewPrv");
        if (ds_Checkuser.Tables[0].Rows.Count == 0)
        {
            Response.Redirect("TransactionLandingPage.aspx");
        }
        else
        {
            //   
        }
    }
}
