コード例 #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                string   OCODE     = ((SessionUser)Session["SessionUser"]).OCode;
                DateTime EDIT_DATE = DateTime.Now;
                Guid     userId    = ((SessionUser)Session["SessionUser"]).UserId;

                var result = objAtt_BLL.UpdateAttStatus_ByDate(Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), ddlShiftCode.Text);
                objAtt_BLL.Update_AbsentLeaveStatus_ByDate(Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), ddlShiftCode.Text, OCODE, EDIT_DATE, userId);
                if (result == 1)
                {
                    lblMessage.Text = "";
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Employee Attendance Status Updated Successfully')", true);

                    txtDateFrom.Text = DateTime.Today.ToShortDateString();
                    txtDateTo.Text   = DateTime.Today.ToShortDateString();
                    ddlShiftCode.ClearSelection();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Status Update Failure!')", true);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }