Beispiel #1
0
        protected void repChld_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            try
            {
                PayrollEditHistory obj = new PayrollEditHistory();
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
                {
                    Label lblField     = (Label)e.Item.FindControl("lblField");
                    Label lblOldvalue  = (Label)e.Item.FindControl("lblOldvalue");
                    Label lblNewValue  = (Label)e.Item.FindControl("lblNewValue");
                    Label lblChangedDt = (Label)e.Item.FindControl("lblChangedDt");

                    string point = obj.ChanngeHistory(lblField.Text, lblOldvalue.Text, lblNewValue.Text, lblChangedDt.Text, Session["LocationName"].ToString().Trim());
                    if (point != "")
                    {
                        Label lblPoint = (Label)e.Item.FindControl("lblPoint");
                        lblPoint.Text = "•  " + point;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
 protected void grdUsers_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     PayrollEditHistory obj = new PayrollEditHistory();
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             Label lblFieldname = (Label)e.Row.FindControl("lblFieldname");
             Label lblFieldOldValue = (Label)e.Row.FindControl("lblFieldOldValue");
             Label lblFieldNewValue = (Label)e.Row.FindControl("lblFieldNewValue");
             lblFieldOldValue.Text = obj.GetName(lblFieldname.Text, lblFieldOldValue.Text);
             lblFieldNewValue.Text = obj.GetName(lblFieldname.Text, lblFieldNewValue.Text);
             if (lblFieldname.Text == "Salary")
             {
                 lblFieldOldValue.Text = GeneralFunction.FormatCurrency(lblFieldOldValue.Text, ddlLocation.SelectedItem.Text);
                 lblFieldNewValue.Text = GeneralFunction.FormatCurrency(lblFieldNewValue.Text, ddlLocation.SelectedItem.Text);
             }
         }
     }
     catch (Exception ex)
     { }
 }
 protected void grdUsers_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     EmployeeBL obj = new EmployeeBL();
     PayrollEditHistory objPay = new PayrollEditHistory();
     try
     {
         if (e.CommandName == "Effective")
         {
             int EffectiveID = Convert.ToInt32(e.CommandArgument.ToString());
             DataTable dt = obj.GetEmpChangesEffectiveByID(EffectiveID);
             hdnEffectID.Value = dt.Rows[0]["EffectiveID"].ToString();
             lblEmpName.Text = dt.Rows[0]["empname"].ToString() + " - " + dt.Rows[0]["empID"].ToString();
             lblFieldname.Text = dt.Rows[0]["ChangeField"].ToString();
             lblEditFieldName.Text = dt.Rows[0]["ChangeField"].ToString();
             lblOldValue.Text = objPay.GetName(dt.Rows[0]["ChangeField"].ToString(), dt.Rows[0]["OldValue"].ToString());
             lblEditOldValue.Text = objPay.GetName(dt.Rows[0]["ChangeField"].ToString(), dt.Rows[0]["OldValue"].ToString());
             lblNewvalue.Text = objPay.GetName(dt.Rows[0]["ChangeField"].ToString(), dt.Rows[0]["NewValue"].ToString());
             lblEffectiveDt.Text = Convert.ToDateTime(dt.Rows[0]["EffectiveDt"].ToString()).ToString("MM/dd/yyyy");
             txtEffectiveDate.Text = Convert.ToDateTime(dt.Rows[0]["EffectiveDt"].ToString()).ToString("MM/dd/yyyy");
             lblStatus.Text = dt.Rows[0]["ChangeStatus"].ToString();
             ddlEditStatus.SelectedIndex = ddlEditStatus.Items.IndexOf(ddlEditStatus.Items.FindByValue(dt.Rows[0]["StatusID"].ToString()));
             dvView.Style["display"] = "block";
             dvEdit.Style["display"] = "none";
             if (lblFieldname.Text == "Salary")
             {
                 lblOldValue.Text = GeneralFunction.FormatCurrency(lblOldValue.Text, ddlLocation.SelectedItem.Text);
                 lblEditOldValue.Text = GeneralFunction.FormatCurrency(lblEditOldValue.Text, ddlLocation.SelectedItem.Text);
                 lblNewvalue.Text = GeneralFunction.FormatCurrency(lblNewvalue.Text, ddlLocation.SelectedItem.Text);
             }
             GetNamesList(lblEditFieldName.Text, dt);
             mdlAddPopUp.Show();
         }
     }
     catch (Exception ex)
     {
     }
 }
        protected void repChld_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            try
            {
                PayrollEditHistory obj = new PayrollEditHistory();
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
                {

                    Label lblField = (Label)e.Item.FindControl("lblField");
                    Label lblOldvalue = (Label)e.Item.FindControl("lblOldvalue");
                    Label lblNewValue = (Label)e.Item.FindControl("lblNewValue");
                    Label lblChangedDt = (Label)e.Item.FindControl("lblChangedDt");

                    string point = obj.ChanngeHistory(lblField.Text, lblOldvalue.Text, lblNewValue.Text, lblChangedDt.Text, Session["LocationName"].ToString().Trim());
                    if (point != "")
                    {
                        Label lblPoint = (Label)e.Item.FindControl("lblPoint");
                        lblPoint.Text = "•  "+point;
                    }
                }

            }
            catch (Exception ex)
            {

            }
        }
        protected void grdEffectChanges_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                PayrollEditHistory obj=new PayrollEditHistory();
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    Label lblChangeField = (Label)e.Row.FindControl("lblChangeField");
                    Label lblNewValue = (Label)e.Row.FindControl("lblNewValue");
                    Label lblOldValue = (Label)e.Row.FindControl("lblOldValue");

                    lblNewValue.Text = obj.GetName(lblChangeField.Text, lblNewValue.Text);
                    lblOldValue.Text = obj.GetName(lblChangeField.Text, lblOldValue.Text);

                    if (lblChangeField.Text == "Salary")
                    {
                        lblNewValue.Text = GeneralFunction.FormatCurrency(lblNewValue.Text, ViewState["Location"].ToString());
                        lblOldValue.Text = GeneralFunction.FormatCurrency(lblOldValue.Text, ViewState["Location"].ToString());

                    }
                }
            }
            catch (Exception ex)
            {
            }
        }