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.Resources;
using System.Net;
using System.Globalization;
using System.Threading;

public partial class Transactions_TA_UI_Transactions_ManualCompensationEntry_View : Base.BasePage
{
    string strCompoffID = string.Empty;
    string strComDate = string.Empty;
    string CompensationDate = string.Empty;
    Cls_CheckUser objCheckUser = new Cls_CheckUser();
    LeaveApplicationEventData objEmployeeEventData = new LeaveApplicationEventData();
    DataSet dsCompensation = new DataSet();
    string gstrDateFormat = string.Empty;
    cls_Common objClassCommon = new cls_Common();
    int intIndividualUser = 0;
    string strFromDateTime;
    bool isValid = true;
    int CompOffID = 0;
    DateTime gdtmBackDate;
    DataSet ds_Checkuser = new DataSet();
    ResourceManager rm;
    CultureInfo ci;
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        ShiftSettingsEventData getShift = new ShiftSettingsEventData();
        DataSet dsShiftSett = new DataSet();
        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;
        loadcss();
        if (Request.QueryString["CoffId"] != null)
        {
            strCompoffID = Request.QueryString["CoffId"].ToString();
        }
        LoadStrings(ci);
        //UserRights();
        if (!IsPostBack)
        {
            dsCompensation = objEmployeeEventData.SelectCompensationDatabyid(Convert.ToInt32(strCompoffID));
            intIndividualUser = objCheckUser.CheckIndividualUser(Convert.ToString(Session["UserGroupName"]));
            DataSet dsEmployeeGroup = new DataSet();
            dsEmployeeGroup = objEmployeeEventData.GetEmployeeGroupName(Convert.ToInt32(Session["EmpAutoId"]));
            if (dsCompensation.Tables[0].Rows.Count > 0)
            {
                lbl_EmployeeID.Text = dsCompensation.Tables[0].Rows[0]["Employee_Id"].ToString();
                lbl_EmployeeName.Text = dsCompensation.Tables[0].Rows[0]["Employee_FirstName"].ToString();
                lbl_LeaveApplicationDate.Text = dsCompensation.Tables[0].Rows[0]["ApplicationDate"].ToString();
                lblFromDate.Text = dsCompensation.Tables[0].Rows[0]["FromDate"].ToString();
                lblType.Text = dsCompensation.Tables[0].Rows[0]["DayWorked"].ToString();
                lblIntime.Text = dsCompensation.Tables[0].Rows[0]["InTime"].ToString();
                lblOuttime.Text = dsCompensation.Tables[0].Rows[0]["OutTime"].ToString();
                lblWorkedHrs.Text = dsCompensation.Tables[0].Rows[0]["WorkedHours"].ToString();
                lblStatus.Text = dsCompensation.Tables[0].Rows[0]["Comp_Status"].ToString();
                lbl_CompOffID.Text = dsCompensation.Tables[0].Rows[0]["Compensation_Id"].ToString();
                lblReason.Text= dsCompensation.Tables[0].Rows[0]["Reason"].ToString();
            }
            gstrDateFormat = Convert.ToString(Session["MDateFormat"]);
        }
    }
    private void UserRights()
    {
        ds_Checkuser = objCheckUser.checkRights(254, Convert.ToInt32(Session["userGroup_Id"]), "viewPrv");
        if (ds_Checkuser.Tables[0].Rows.Count == 0)
        {
            Response.Redirect("TransactionLandingPage.aspx");
        }
    }
    protected void btn_Cancel_Click(object sender, EventArgs e)
    {
        Response.Redirect("../Transactions/TA_UI_Transactions_ManualCompensationEntry.aspx");
    }
    protected void btn_Delete_Click(object sender, EventArgs e)
    {
      
    }
    private void LoadStrings(CultureInfo ci)
    {
        lblEmployeeIDLabel.Text = rm.GetString("email_EmployeeId", ci);
        //lblEmployeeIDLabel1.Text = rm.GetString("email_EmployeeId", ci);
        lblEmployeeNameLabel.Text = rm.GetString("email_EmployeeName", ci);
        //lblEmployeeNameLabel1.Text = rm.GetString("email_EmployeeName", ci);
        lblLeaveApplicationDate.Text = rm.GetString("LeaveApplication_LeaveApplicationDate", ci);
        lblFromDateLabel.Text = rm.GetString("lbl_DutyDate", ci);
        lbl_InTime.Text = rm.GetString("ManualTimeEntry_In_Time", ci);
        lbl_outTime.Text = rm.GetString("ManualTimeEntry_Out_Time", ci);
        lbl_DayWorked.Text = rm.GetString("lbl_Dayworked", ci);
        lbl_WorkedHrs.Text = rm.GetString("lbl_ExtraWorkedHrs", ci);
        lblReason.Text = rm.GetString("email_Reason", ci);
    }
    protected void btnEdit_Click(object sender, EventArgs e)
    {
      
    }

    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
        htmlLeaveView.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";
            stylefonts.Href = "../dist/css/fonts.css";
        }
        else
        {
            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";
            stylefonts.Href = "../dist/css/fonts.css";
        }
    }
}
