using System;
using System.Data;
using System.Globalization;
using System.Resources;
using System.Threading;
using System.Web.UI.WebControls;
/****************************************************************************************************************************
* Project Name    : TimeCheck                                   Started Date  : 12-Aug-2007
* Module          : Leave Policy                                Last Modified : 14-Aug-2007
* Programmer      : Arun Vinoth.T
* Current Storage : \\Angler56\Projects\Inprogress\SCREEN1206\code\Time_AttendanceApp
* BackUp          :
****************************************************************************************************************************/
public partial class Master_TA_UI_MasterLeavePolicyView : Base.BasePage
{
    #region "Variable Declaration"
    ResourceManager rm;
    CultureInfo ci;
    LeaveEventData objLeave = new LeaveEventData();
    cls_Common objCommon = new cls_Common();
    Cls_CheckUser objCheckUser = new Cls_CheckUser();
    DataSet ds_Checkuser = new DataSet();
    string gstrUserGroupName = string.Empty;
    int intPolicyID = 0;
    int EmployeeID = 0;
    #endregion
    #region Page Load
    protected override void Page_Load(object sender, EventArgs e)
    {
        // session checking
        base.Page_Load(sender, e);
        //get the culture info to set the language
        string source_Language;
        source_Language = Convert.ToString(Session["Session_ActiveLanguage"]);
        rm = new ResourceManager(source_Language, System.Reflection.Assembly.Load("App_GlobalResources"));
        ci = Thread.CurrentThread.CurrentCulture;
        // LoadStrings Function fills the Label from the Resource File
        LoadStrings(ci);
        loadcss();
        EmployeeID = Convert.ToInt32(Session["EmpAutoID"]);
        //Set UserRights
        if (!IsPostBack)
        {
            UserRights();
            gstrUserGroupName = Convert.ToString(Session["UserGroupName"]);
            intPolicyID = Convert.ToInt32(Request.QueryString["Policy_Id"]);
            DataSet ds_LeaveType = new DataSet();
            DataSet ds_LeavePolicy = new DataSet();
            ds_LeavePolicy = objLeave.SelectLeavePolicyByID(intPolicyID, gstrUserGroupName);
            DataSet ds_leavePolicyDetails = new DataSet();
            ds_leavePolicyDetails = objLeave.SelectLeavePolicyDetails(intPolicyID);
            if (gstrUserGroupName != "SuperAdmin")
            {
                lbl_RecordStatus.Visible = false;
                lbl_DeleteStatus.Visible = false;
            }
            if (ds_LeavePolicy != null && ds_LeavePolicy.Tables[0].Rows.Count > 0)
            {
                #region "Filling Leave Policy"
                if (Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["CompanyName"]) != null)
                {
                    lblSelectedCompany.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["CompanyName"]);
                }
                // filling Leave policy 
                lblPolicyName.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["PolicyName"]);
                if (Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["EmployeeCategorys"]) != "")
                {
                    lblEmployeeCategory.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["EmployeeCategorys"]);
                }
                else
                {
                    lblEmployeeCategory.Text = "All";
                }
                if (Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["EmployeeTypes"]) != "")
                {
                    lblEmployeeType.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["EmployeeTypes"]);
                }
                else
                {
                    lblEmployeeType.Text = "All";
                }
                if (Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["Gender"]) != "")
                {
                    lbl_Gender.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["Gender"]);
                }
                else
                {
                    lbl_Gender.Text = "Both";
                }
                if (Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["Religions"]) != "")
                {
                    lbl_Religion.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["Religions"]);
                }
                else
                {
                    lbl_Religion.Text = "All";
                }
                lblMaxHrsMonth.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["Permission_MaxHrs_Month"]);
                lblMaxInsMonth.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["Permission_MaxInstances_Month"]);
                lblMaxHrsIns.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["Permission_MaxHrs_Instance"]);
                lblminHrs_InstanceVal.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["Permission_MinHrs_Instance"]);
                lblPermissionAfterLeaveData.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["PermissionAfterLeave"]);
                lblPermissionBeforeLeaveData.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["PermissionBeforeLeave"]);
                if (lblPermissionAfterLeaveData.Text == "True")
                {
                    //lblPermissionAfterLeaveData.Text = rm.GetString("Grid_True", ci);
                    chkAfterLeave.Checked = true;
                }
                else if (lblPermissionAfterLeaveData.Text == "False")
                {
                    //lblPermissionAfterLeaveData.Text = rm.GetString("Grid_False", ci);
                    chkAfterLeave.Checked = false;
                }
                if (lblPermissionBeforeLeaveData.Text == "True")
                {
                    //lblPermissionBeforeLeaveData.Text = rm.GetString("Grid_True", ci);
                    chkBeforeLeave.Checked = true;
                }
                else if (lblPermissionBeforeLeaveData.Text == "False")
                {
                    chkBeforeLeave.Checked = false;
                    //lblPermissionBeforeLeaveData.Text = rm.GetString("Grid_False", ci);
                }
                lblOtHourWiseData.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["OtHourWise"]);
                lblOtDayWiseData.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["OtDayWise"]);
                if (lblOtHourWiseData.Text == "True")
                {
                    //lblOtHourWiseData.Text = rm.GetString("Grid_True", ci);
                    rbt_HourWise.Checked = true;
                }
                else if (lblOtHourWiseData.Text == "False")
                {
                    //lblOtHourWiseData.Text = rm.GetString("Grid_False", ci);
                    rbt_HourWise.Checked = false;
                }
                if (lblOtDayWiseData.Text == "True")
                {
                    rbt_DayWise.Checked = true;
                    //lblOtDayWiseData.Text = rm.GetString("Grid_True", ci);
                }
                else if (lblOtDayWiseData.Text == "False")
                {
                    rbt_DayWise.Checked = false;
                    //lblOtDayWiseData.Text = rm.GetString("Grid_False", ci);
                }
                lblHalfDayComoffText.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["OtMinHrs"]);
                lblFullDayComoffText.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["FullDayOTMinHrs"]);
                lblValidsDaysText.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["CompOffValidDays"]);
                lbl_DeleteStatus.Text = Convert.ToString(ds_LeavePolicy.Tables[0].Rows[0]["IsDeleted"]);
                if (lbl_DeleteStatus.Text == "True")
                {
                    lbl_DeleteStatus.Text = rm.GetString("Grid_True", ci);
                }
                else if (lbl_DeleteStatus.Text == "False")
                {
                    lbl_DeleteStatus.Text = rm.GetString("Grid_False", ci);
                }
                #endregion
                #region "Filling Leave Policy Details"
                // filling Leave policy details
                if (ds_leavePolicyDetails != null && ds_leavePolicyDetails.Tables[0].Rows.Count > 0)
                {
                    int i = 1;

                    #region "Existing Leave types"
                    foreach (DataRow dr in ds_leavePolicyDetails.Tables[0].Rows)
                    {
                        TableRow tr = new TableRow();
                        tr.CssClass = "lve-text lve-potablebg";
                        TableCell tc_Type = new TableCell();
                        tc_Type.Text = Convert.ToString(dr["LeaveType"]);
                        tr.Cells.Add(tc_Type);
                        TableCell tc_Total = new TableCell();
                        tc_Total.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl = new Label();
                        lbl.Text = Convert.ToString(dr["MaxDays_applicable"]);
                        tc_Total.Controls.Add(lbl);
                        tr.Cells.Add(tc_Total);
                        TableCell tc_MaxDaysPerMonth = new TableCell();
                        tc_MaxDaysPerMonth.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_MaxDaysPerMonth = new Label();

                        lbl_MaxDaysPerMonth.Text = Convert.ToString(dr["MaxDays_Month"]);
                        tc_MaxDaysPerMonth.Controls.Add(lbl_MaxDaysPerMonth);
                        tr.Cells.Add(tc_MaxDaysPerMonth);

                        TableCell tc_Max = new TableCell();
                        tc_Max.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_Max = new Label();
                        lbl_Max.Text = Convert.ToString(dr["MaxDays_avail"]);
                        tc_Max.Controls.Add(lbl_Max);
                        tr.Cells.Add(tc_Max);
                        TableCell tc_Min = new TableCell();
                        tc_Min.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_Min = new Label();
                        lbl_Min.Text = Convert.ToString(dr["MinDays_avail"]);
                        tc_Min.Controls.Add(lbl_Min);
                        tr.Cells.Add(tc_Min);
                        TableCell tc_Spell = new TableCell();
                        tc_Spell.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_Spell = new Label();
                        lbl_Spell.Text = Convert.ToString(dr["Spells"]);
                        tc_Spell.Controls.Add(lbl_Spell);
                        tr.Cells.Add(tc_Spell);
                        TableCell tc_Loss = new TableCell();
                        tc_Loss.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_Loss = new Label();
                        if (Convert.ToString(dr["LossOfPay"]) == "True")
                        {
                            lbl_Loss.Text = rm.GetString("ShiftSetting_Yes", ci);
                        }
                        else
                        {
                            lbl_Loss.Text = rm.GetString("ShiftSetting_No", ci);
                        }
                        tc_Loss.Controls.Add(lbl_Loss);
                        tr.Cells.Add(tc_Loss);
                        TableCell tc_MaxLOP = new TableCell();
                        tc_MaxLOP.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_LOP = new Label();
                        lbl_LOP.Text = Convert.ToString(dr["Max_LOP_Days"]);
                        tc_MaxLOP.Controls.Add(lbl_LOP);
                        tr.Cells.Add(tc_MaxLOP);
                        TableCell tc_Count = new TableCell();
                        tc_Count.Width = Unit.Pixel(78);
                        tc_Count.HorizontalAlign = HorizontalAlign.Left;
                        Label lbl_Count = new Label();
                        lbl_Count.Width = 78;
                        Label lbl_Count1 = new Label();
                        lbl_Count1.Width = 78;
                        Label lbl_Count2 = new Label();
                        lbl_Count2.Width = 82;
                        if (Convert.ToString(dr["Count_BeforeWeeklyOff"]) == "True")
                        {
                            lbl_Count.Text = rm.GetString("BeforeYes", ci);
                        }
                        else
                        {
                            lbl_Count.Text = rm.GetString("BeforeNo", ci);
                        }
                        if (Convert.ToString(dr["Count_AfterWeeklyOff"]) == "True")
                        {
                            lbl_Count1.Text = rm.GetString("AfterYes", ci);
                        }
                        else
                        {
                            lbl_Count1.Text = rm.GetString("AfterNo", ci);
                        }
                        if (Convert.ToString(dr["Count_Intervening"]) == "True")
                        {
                            lbl_Count2.Text = rm.GetString("InterveningYes", ci);
                        }
                        else
                        {
                            lbl_Count2.Text = rm.GetString("InterveningNo", ci);
                        }
                        tc_Count.Controls.Add(lbl_Count);
                        tc_Count.Controls.Add(lbl_Count1);
                        tc_Count.Controls.Add(lbl_Count2);
                        tr.Cells.Add(tc_Count);
                        TableCell tc_Borrow = new TableCell();
                        tc_Borrow.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_Borrow = new Label();
                        if (Convert.ToString(dr["Borrow_FromNextYear"]) == "True")
                        {
                            lbl_Borrow.Text = rm.GetString("ShiftSetting_Yes", ci);
                        }
                        else
                        {
                            lbl_Borrow.Text = rm.GetString("ShiftSetting_No", ci);
                        }
                        tc_Borrow.Controls.Add(lbl_Borrow);
                        tr.Cells.Add(tc_Borrow);
                        TableCell tc_Carry = new TableCell();
                        tc_Carry.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_Carry = new Label();
                        if (Convert.ToString(dr["Carry_ToNextYear"]) == "True")
                        {
                            lbl_Carry.Text = rm.GetString("ShiftSetting_Yes", ci);
                        }
                        else
                        {
                            lbl_Carry.Text = rm.GetString("ShiftSetting_No", ci);
                        }
                        tc_Carry.Controls.Add(lbl_Carry);
                        tr.Cells.Add(tc_Carry);
                        TableCell tc_MaxAcc = new TableCell();
                        tc_MaxAcc.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_MaxAcc = new Label();
                        lbl_MaxAcc.Text = Convert.ToString(dr["MaxDays_Acc"]);
                        tc_MaxAcc.Controls.Add(lbl_MaxAcc);
                        tr.Cells.Add(tc_MaxAcc);
                        TableCell tc_Encash = new TableCell();
                        tc_Encash.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_Encash = new Label();
                        if (Convert.ToString(dr["Encashment"]) == "True")
                        {
                            lbl_Encash.Text = rm.GetString("ShiftSetting_Yes", ci);
                        }
                        else
                        {
                            lbl_Encash.Text = rm.GetString("ShiftSetting_No", ci);
                        }
                        tc_Encash.Controls.Add(lbl_Encash);
                        tr.Cells.Add(tc_Encash);
                        TableCell tc_AppAfter = new TableCell();
                        tc_AppAfter.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_AppAfter = new Label();
                        lbl_AppAfter.Text = Convert.ToString(dr["ApplicableAfterDays"]);
                        tc_AppAfter.Controls.Add(lbl_AppAfter);
                        tr.Cells.Add(tc_AppAfter);
                        TableCell tc_CalcFactor = new TableCell();
                        tc_CalcFactor.Visible = true;
                        tc_CalcFactor.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_CalcFactor = new Label();
                        lbl_CalcFactor.Text = Convert.ToString(dr["Calc_Factor"]);
                        tc_CalcFactor.Controls.Add(lbl_CalcFactor);
                        tr.Cells.Add(tc_CalcFactor);
                        TableCell tc_WorkDays = new TableCell();
                        tc_WorkDays.Visible = true;
                        tc_WorkDays.HorizontalAlign = HorizontalAlign.Center;
                        Label lbl_WorkDays = new Label();
                        lbl_WorkDays.Text = Convert.ToString(dr["MinWorkDays"]);
                        tc_WorkDays.Controls.Add(lbl_WorkDays);
                        tr.Cells.Add(tc_WorkDays);
                        TableCell tc_CountFactor = new TableCell();
                        tc_CountFactor.Visible = true;
                        tc_CountFactor.Width = Unit.Pixel(78);
                        tc_CountFactor.HorizontalAlign = HorizontalAlign.Left;
                        Label lbl_Weekdays = new Label();
                        lbl_Weekdays.Width = 78;
                        if (Convert.ToString(dr["Weekdays"]) == "True")
                        {
                            lbl_Weekdays.Text = rm.GetString("WkDayYes", ci);
                        }
                        else
                        {
                            lbl_Weekdays.Text = rm.GetString("WkDayNo", ci);
                        }
                        Label lbl_WeekOff = new Label();
                        lbl_WeekOff.Width = 78;
                        if (Convert.ToString(dr["WeekOff"]) == "True")
                        {
                            lbl_WeekOff.Text = rm.GetString("WkOffYes", ci);
                        }
                        else
                        {
                            lbl_WeekOff.Text = rm.GetString("WkOffNo", ci);
                        }
                        Label lbl_Leave = new Label();
                        lbl_Leave.Width = 78;
                        if (Convert.ToString(dr["Leave"]) == "True")
                        {
                            lbl_Leave.Text = rm.GetString("LeaveYes", ci);
                        }
                        else
                        {
                            lbl_Leave.Text = rm.GetString("LeaveNo", ci);
                        }
                        Label lbl_Holidays = new Label();
                        if (Convert.ToString(dr["Holidays"]) == "True")
                        {
                            lbl_Holidays.Text = rm.GetString("HolidaysYes", ci);
                        }
                        else
                        {
                            lbl_Holidays.Text = rm.GetString("HolidaysNo", ci);
                        }
                        tc_CountFactor.Controls.Add(lbl_Weekdays);
                        tc_CountFactor.Controls.Add(lbl_WeekOff);
                        tc_CountFactor.Controls.Add(lbl_Leave);
                        tc_CountFactor.Controls.Add(lbl_Holidays);
                        tr.Cells.Add(tc_CountFactor);
                        TableCell tc_TypeID = new TableCell();
                        Label lbl_TypeID = new Label();
                        lbl_TypeID.Text = Convert.ToString(dr["LeaveType_Id"]);
                        tc_TypeID.Controls.Add(lbl_TypeID);
                        tr.Cells.Add(tc_TypeID);
                        tc_TypeID.Visible = false;

                        TableCell tc_AvailNoTimes_Service = new TableCell();
                        tc_AvailNoTimes_Service.HorizontalAlign = HorizontalAlign.Center;
                        Label txtAvailNoTime = new Label();
                        txtAvailNoTime.Text = Convert.ToString(dr["AvailServicePeriod"]);
                        tc_AvailNoTimes_Service.Controls.Add(txtAvailNoTime);
                        Label lblTimes = new Label();
                        lblTimes.Text = " Time(s)";
                        tc_AvailNoTimes_Service.Controls.Add(lblTimes);
                        tr.Cells.Add(tc_AvailNoTimes_Service);
                        tbl_LeavePolicy.Rows.Add(tr);
                        i = i + 1;
                    }
                    #endregion
                }
                #endregion
            }
            objCommon.menu("LeaveMasters", "196");
        }
    }
    #endregion
    #region UserDefinedFunctions
    //Getting Information from resource file and display it in label
    private void LoadStrings(CultureInfo ci)
    {
        lblminHrs_Instance.Text = rm.GetString("LeavePermissionPolicy_MinPermission_Hr_Per_Instance", ci);
        lblCompany.Text = rm.GetString("EntranceMaster_Company", ci);
        lbl_MaxNoOfInstancesPerMonth.Text = rm.GetString("LeavePermissionPolicy_MaxNo_Of_Instances_Per_Month", ci);
        lbl_MaxPermissionHoursPerInstance.Text = rm.GetString("LeavePermissionPolicy_MaxPermission_Hr_Per_Instance", ci);
        lbl_MaxPermissionHoursPerMonth.Text = rm.GetString("LeavePermissionPolicy_MaxPermission_Hr_Per_Month", ci);
        lbl_PolicyName.Text = rm.GetString("LeavePermissionPolicy_PolicyName", ci);
        lbl_HeaderLeavePolicy.Text = rm.GetString("Masters_Leave_LeavePermissionPolicy", ci);
        lbl_RecordStatus.Text = rm.GetString("DeleteStatus", ci);
        lblGender.Text = rm.GetString("EmployeeMaster_Gender", ci);
        lblReligion.Text = rm.GetString("EmployeeMaster_Religion", ci);
        lblEmpCategory.Text = rm.GetString("Master_Category", ci);
        lblEmpType.Text = rm.GetString("Master_Type", ci);
        //lbl_PermissionAfterLeave.Text = rm.GetString("Permission_After_Leave", ci);
        //lbl_PermissionBeforeLeave.Text = rm.GetString("Permission_Before_Leave", ci);
        chkBeforeLeave.Text = rm.GetString("Permission_Before_Leave", ci);
        chkAfterLeave.Text = rm.GetString("Permission_After_Leave", ci);
        //lbl_OtHourWise.Text = rm.GetString("rbtn_HourWise", ci);
        //lbl_OtDayWise.Text = rm.GetString("rbtn_DayWise", ci);
        rbt_HourWise.Text = rm.GetString("rbtn_HourWise", ci);
        rbt_DayWise.Text = rm.GetString("rbtn_DayWise", ci);
        lblLeaveType.Text = rm.GetString("lbl_leavetype", ci);
        lblApplicableDays.Text = rm.GetString("LeavePolicy_AppDays", ci);
        lblMaxDaysSpell.Text = rm.GetString("LeavePolicy_MaxDaysPerSpell", ci);
        lblMinDaysSpell.Text = rm.GetString("LeavePolicy_MinDaysPerSpell", ci);
        lblSpellsyear.Text = rm.GetString("LeavePlicy_SpellsPeryear", ci);
        lblLOP.Text = rm.GetString("lbl_LOP", ci);
        lblMaxLOP.Text = rm.GetString("LeavePolicy_MaxLOP", ci);
        lblCountWeekoff.Text = rm.GetString("LeavePolicy_CountWeekoff", ci);
        lblBorrow.Text = rm.GetString("LeavePlocy_Borrow", ci);
        lblCarryOver.Text = rm.GetString("LeavePolicy_CarryOver", ci);
        lblMAccdays.Text = rm.GetString("LeavePolicy_MaxAccDays", ci);
        lblEncash.Text = rm.GetString("LeavePolicy_Encash", ci);
        lblApplAfterDays.Text = rm.GetString("LeavePolicy_ApplAfterDays", ci);
        lblCalcFactor.Text = rm.GetString("LeavePolicy_CalcFactor", ci);
        lblWorkDays.Text = rm.GetString("LeavePolicy_MinWorkDays", ci);
        lblCountFactor.Text = rm.GetString("lblCountFactor", ci);
        lblHalfDayComoff.Text = rm.GetString("Min_Hrs_HalfDay_Comoff", ci);
        lblFullDayComoff.Text = rm.GetString("Min_Hrs_FullDay_Comoff", ci);
        lblValidsDays.Text = rm.GetString("CompOff_Validity_Days", ci);
        lblMaxDaysPerMon.Text = rm.GetString("LeavePolicy_MaxDaysPerMon", ci);
        lbl_LeaveConfi.Text = rm.GetString("Leave_LeaveConfiguration", ci);
        lblPermissionHeading.Text = rm.GetString("UserGroups_Permission", ci);
        lblCompOffConfig.Text = rm.GetString("CompOff_Type", ci);
    }
    private void UserRights()
    {
        ds_Checkuser = objCheckUser.checkRights(196, Convert.ToInt32(Session["userGroup_Id"]), "");
        if (ds_Checkuser.Tables[0].Rows.Count > 0)
        {
            if (ds_Checkuser.Tables[0].Rows[0]["viewPrv"] == DBNull.Value || Convert.ToInt32(ds_Checkuser.Tables[0].Rows[0]["viewPrv"]) != 1)
            {
                Response.Redirect("TA_UI_MasterLeavePolicyList.aspx");
            }
        }
        else
        {
            Response.Redirect("MasterLandingPage.aspx");
        }
    }

    private void loadcss()
    {
        CultureInfo ci;
        string source_Language;
        source_Language = Convert.ToString(Session["Session_ActiveLanguage"]);
        rm = new ResourceManager(source_Language, System.Reflection.Assembly.Load("App_GlobalResources"));
        ci = Thread.CurrentThread.CurrentCulture;
        //if Standard Demo
        htmlLeavePolicy.Attributes.Add("dir", rm.GetString("Direction", ci));
        if (source_Language == "Resources.Resource_AR")
        {
            stylebootstrap.Href = "../bootstrap/css/bootstrap-rtl.min.css";
            stylefontawesome.Href = "../bootstrap/font-awesome/css/font-awesome-rtl.css";
            styleAdminLTE.Href = "../dist/css/AdminLTE.min-rtl.css";
            stylecustom.Href = "../dist/css/custom-rtl.css";
            stylebuild.Href = "../bootstrap/font-awesome/css/build-rtl.css";
            stylefonts.Href = "../dist/css/fonts.css";
        }
        else
        {
            //htmlLeavePolicy.Attributes.Add("dir", "rtl");
            //stylebootstrap.Href = "../bootstrap/css/bootstrap-rtl.min.css";
            //stylefontawesome.Href = "../bootstrap/font-awesome/css/font-awesome-rtl.css";
            //styleAdminLTE.Href = "../dist/css/AdminLTE.min-rtl.css";
            //stylecustom.Href = "../dist/css/custom-rtl.css";
            //stylebuild.Href = "../bootstrap/font-awesome/css/build-rtl.css";
            //stylefonts.Href = "../dist/css/fonts.css";
            stylebootstrap.Href = "../bootstrap/css/bootstrap.min.css";
            stylefontawesome.Href = "../bootstrap/font-awesome/css/font-awesome.css";
            styleAdminLTE.Href = "../dist/css/AdminLTE.min.css";
            stylecustom.Href = "../dist/css/custom.css";
            stylebuild.Href = "../bootstrap/font-awesome/css/build.css";
            stylefonts.Href = "../dist/css/fonts.css";
        }
    }
    #endregion
}