Beispiel #1
0
        public void FillEMPLOYEEAttendanceTranDetails()
        {
            try
            {
                DataTable Dt = new DataTable();
                Dt = EMP_MASLogicLayer.GetAllEmployeeSalDetailsForAttenMas(Session["COMP_CODE"].ToString(), Convert.ToDateTime(TxtAttendanceDate.Text.Trim()));

                GvEmployeeAttendanceTransaction.DataSource = Dt;
                GvEmployeeAttendanceTransaction.DataBind();
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #2
0
        private void SetInitialRowEmpTransaction()
        {
            DataTable table = new DataTable();
            DataRow   dr    = null;

            table.Columns.Add("COMP_CODE", typeof(string));
            table.Columns.Add("TRAN_DATE", typeof(string));
            table.Columns.Add("TRAN_NO", typeof(string));
            table.Columns.Add("EMP_CODE", typeof(string));
            table.Columns.Add("ATTN_FLAG", typeof(string));
            table.Columns.Add("PAY_AMT", typeof(string));
            table.Columns.Add("OT_HOURS", typeof(string));
            table.Columns.Add("INS_USERID", typeof(string));
            table.Columns.Add("INS_TERMINAL", typeof(string));
            table.Columns.Add("INS_DATE", typeof(string));
            table.Columns.Add("UPD_USERID", typeof(string));
            table.Columns.Add("UPD_TERMINAL", typeof(string));
            table.Columns.Add("UPD_DATE", typeof(string));
            table.Columns.Add("EMP_NAME", typeof(string));



            dr = table.NewRow();


            dr["COMP_CODE"]    = string.Empty;
            dr["TRAN_DATE"]    = string.Empty;
            dr["TRAN_NO"]      = string.Empty;
            dr["EMP_CODE"]     = string.Empty;
            dr["ATTN_FLAG"]    = "P";
            dr["PAY_AMT"]      = string.Empty;
            dr["OT_HOURS"]     = string.Empty;
            dr["INS_USERID"]   = string.Empty;
            dr["INS_TERMINAL"] = string.Empty;
            dr["INS_DATE"]     = string.Empty;
            dr["UPD_USERID"]   = string.Empty;
            dr["UPD_TERMINAL"] = string.Empty;
            dr["UPD_DATE"]     = string.Empty;
            dr["EMP_NAME"]     = string.Empty;


            table.Rows.Add(dr);

            ViewState["CurrentTable"] = table;

            GvEmployeeAttendanceTransaction.DataSource = table;
            GvEmployeeAttendanceTransaction.DataBind();
        }
Beispiel #3
0
        protected void GvEmployeeAttendanceMaster_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Deletea")
                {
                    #region DELETE
                    //     clear();

                    int id = int.Parse(e.CommandArgument.ToString());

                    Control ctrl = e.CommandSource as Control;
                    if (ctrl != null)
                    {
                        GridViewRow row = ctrl.Parent.NamingContainer as GridViewRow;

                        HiddenField HfTranDateGrid = (row.FindControl("HfTranDateGrid")) as HiddenField;


                        DataSet   ds        = ATTN_MASLogicLayer.GetAllIDWiseATTENDANCE_MASDetials(e.CommandArgument.ToString(), Convert.ToDateTime(HfTranDateGrid.Value.ToString()));
                        DataTable dt        = ds.Tables[0];
                        DataTable DtDetails = ds.Tables[1];

                        if (dt.Rows.Count > 0)
                        {
                            DivEntry.Visible = true;
                            DivView.Visible  = false;

                            HfCompCode.Value             = dt.Rows[0]["COMP_CODE"].ToString();
                            HfTranDate.Value             = dt.Rows[0]["TRAN_DATE"].ToString();
                            HfTranNo.Value               = dt.Rows[0]["TRAN_NO"].ToString();
                            TxtAttendanceDate.Text       = Convert.ToDateTime(dt.Rows[0]["ATTN_DATE"].ToString()).ToString("dd-MM-yyyy");
                            DdlHolidayFlag.SelectedValue = dt.Rows[0]["HOLIDAY"].ToString();
                            TxtRemark.Text               = dt.Rows[0]["REMARK"].ToString();
                        }

                        if (DtDetails.Rows.Count > 0)
                        {
                            GvEmployeeAttendanceTransaction.DataSource = DtDetails;
                            GvEmployeeAttendanceTransaction.DataBind();
                        }


                        btnSave.Visible    = false;
                        btnDelete.Visible  = true;
                        Btncalldel.Visible = true;
                        BtncallUpd.Visible = false;
                        ControllerDisable();
                    }

                    #endregion
                }



                if (e.CommandName == "Edita")
                {
                    #region EDIT
                    //     clear();

                    int id = int.Parse(e.CommandArgument.ToString());

                    Control ctrl = e.CommandSource as Control;
                    if (ctrl != null)
                    {
                        GridViewRow row = ctrl.Parent.NamingContainer as GridViewRow;

                        HiddenField HfTranDateGrid = (row.FindControl("HfTranDateGrid")) as HiddenField;


                        DataSet   ds        = ATTN_MASLogicLayer.GetAllIDWiseATTENDANCE_MASDetials(e.CommandArgument.ToString(), Convert.ToDateTime(HfTranDateGrid.Value.ToString()));
                        DataTable dt        = ds.Tables[0];
                        DataTable DtDetails = ds.Tables[1];

                        if (dt.Rows.Count > 0)
                        {
                            DivEntry.Visible = true;
                            DivView.Visible  = false;

                            HfCompCode.Value             = dt.Rows[0]["COMP_CODE"].ToString();
                            HfTranDate.Value             = dt.Rows[0]["TRAN_DATE"].ToString();
                            HfTranNo.Value               = dt.Rows[0]["TRAN_NO"].ToString();
                            TxtAttendanceDate.Text       = Convert.ToDateTime(dt.Rows[0]["ATTN_DATE"].ToString()).ToString("dd-MM-yyyy");
                            DdlHolidayFlag.SelectedValue = dt.Rows[0]["HOLIDAY"].ToString();
                            TxtRemark.Text               = dt.Rows[0]["REMARK"].ToString();
                        }

                        if (DtDetails.Rows.Count > 0)
                        {
                            GvEmployeeAttendanceTransaction.DataSource = DtDetails;
                            GvEmployeeAttendanceTransaction.DataBind();
                        }

                        BtncallUpd.Text = "UPDATE";

                        #endregion
                    }


                    #region CHECK UPDATE RIGHTS
                    if (Session["UPDATE"] != null)
                    {
                        if (Session["UPDATE"].ToString() == "Y")
                        {
                            ControllerEnable();
                        }
                        else
                        {
                            ControllerDisable();
                        }
                    }
                    #endregion
                    Btncalldel.Visible = false;
                    BtncallUpd.Visible = true;
                    btnSave.Visible    = true;
                    UserRights();
                }


                if (e.CommandName == "Viewa")
                {
                    #region SET TEXT ON VIEW
                    //     clear();


                    int id = int.Parse(e.CommandArgument.ToString());

                    Control ctrl = e.CommandSource as Control;
                    if (ctrl != null)
                    {
                        GridViewRow row = ctrl.Parent.NamingContainer as GridViewRow;

                        HiddenField HfTranDateGrid = (row.FindControl("HfTranDateGrid")) as HiddenField;


                        DataSet   ds        = ATTN_MASLogicLayer.GetAllIDWiseATTENDANCE_MASDetials(e.CommandArgument.ToString(), Convert.ToDateTime(HfTranDateGrid.Value.ToString()));
                        DataTable dt        = ds.Tables[0];
                        DataTable DtDetails = ds.Tables[1];

                        if (dt.Rows.Count > 0)
                        {
                            DivEntry.Visible = true;
                            DivView.Visible  = false;

                            HfCompCode.Value             = dt.Rows[0]["COMP_CODE"].ToString();
                            HfTranDate.Value             = dt.Rows[0]["TRAN_DATE"].ToString();
                            HfTranNo.Value               = dt.Rows[0]["TRAN_NO"].ToString();
                            TxtAttendanceDate.Text       = Convert.ToDateTime(dt.Rows[0]["ATTN_DATE"].ToString()).ToString("dd-MM-yyyy");
                            DdlHolidayFlag.SelectedValue = dt.Rows[0]["HOLIDAY"].ToString();
                            TxtRemark.Text               = dt.Rows[0]["REMARK"].ToString();
                        }

                        if (DtDetails.Rows.Count > 0)
                        {
                            GvEmployeeAttendanceTransaction.DataSource = DtDetails;
                            GvEmployeeAttendanceTransaction.DataBind();
                        }

                        #endregion
                        ControllerDisable();
                        btnSave.Visible    = false;
                        Btncalldel.Visible = false;
                        BtncallUpd.Visible = false;
                        UserRights();
                    }
                }
            }
            catch (Exception EX)
            {
                EX.ToString();
            }
        }