Ejemplo n.º 1
0
        private void BindgvShift()
        {
            ApplicationResult objResult      = new ApplicationResult();
            ShiftBl           objReceptionBl = new ShiftBl();

            objResult = objReceptionBl.Shift_SelectAll();
            if (objResult != null)
            {
                gvShift.DataSource = objResult.ResultDt;
                gvShift.DataBind();
                PanelVisibilityMode(true, false);
            }
        }
Ejemplo n.º 2
0
        //protected void BindReceptionLineNo()
        //{

        //    ddlReceptionLineNo.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select All--", "-1"));
        //    ddlReceptionLineNo.Items.Insert(1, new System.Web.UI.WebControls.ListItem("RMST", "1"));
        //    ddlReceptionLineNo.Items.Insert(2, new System.Web.UI.WebControls.ListItem("PMST", "2"));
        //    ddlReceptionLineNo.Items.Insert(3, new System.Web.UI.WebControls.ListItem("CBST", "3"));
        //}
        #endregion


        #region Bind Shift No
        protected void BindShiftNo()
        {
            Controls objControls = new Controls();
            ShiftBl  objShiftBl  = new ShiftBl();
            var      objResult   = objShiftBl.Shift_SelectAll();

            if (objResult != null)
            {
                if (objResult.ResultDt.Rows.Count > 0)
                {
                    //objControls.BindDropDown_ListBox(objResult.ResultDt, ddlShiftNo, "Name", "ShiftId");
                }
                //ddlShiftNo.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select All--", "-1"));
            }
        }
Ejemplo n.º 3
0
 protected void gvShift_OnRowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         ShiftBl objShiftBL = new ShiftBl();
         if (e.CommandName == "Edit1")
         {
             ViewState["Mode"] = "Edit";
             ViewState["ID"]   = e.CommandArgument.ToString();
             var objResult = objShiftBL.Shift_Select(Convert.ToInt32(ViewState["ID"].ToString()));
             if (objResult != null)
             {
                 if (objResult.ResultDt.Rows.Count > 0)
                 {
                     txtName.Text     = objResult.ResultDt.Rows[0][ShiftBo.SHIFT_NAME].ToString();
                     txtFromTime.Text = objResult.ResultDt.Rows[0][ShiftBo.SHIFT_FROMTIME].ToString();
                     txtToTime.Text   = objResult.ResultDt.Rows[0][ShiftBo.SHIFT_TOTIME].ToString();
                     PanelVisibilityMode(false, true);
                 }
             }
         }
         else if (e.CommandName == "Delete1")
         {
             var objResult = objShiftBL.Shift_Delete(Convert.ToInt32(e.CommandArgument.ToString()), Convert.ToInt32(Session[ApplicationSession.Userid].ToString()), System.DateTime.UtcNow.AddHours(5.5).ToString());
             if (objResult.Status == ApplicationResult.CommonStatusType.Success)
             {
                 ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Record Deleted Successfully.');</script>");
                 PanelVisibilityMode(true, false);
                 BindgvShift();
             }
             else
             {
                 ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('You can not delete this Reception because it is in used.');</script>");
             }
         }
     }
     catch (Exception ex)
     {
         log.Error("Error", ex);
         ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical Problem. Contact to your Administrator.');</script>");
     }
 }
Ejemplo n.º 4
0
 protected void btnSave_OnClick(object sender, EventArgs e)
 {
     try
     {
         ShiftBo objShiftBo  = new ShiftBo();
         ShiftBl objShiftBl  = new ShiftBl();
         string  strFromTime = string.Empty;
         string  strToTime   = string.Empty;
         objShiftBo.Name = txtName.Text.Trim();
         strFromTime     = txtFromTime.Text;
         strToTime       = txtToTime.Text;
         if (ViewState["Mode"].ToString() == "Save")
         {
             objShiftBo.CreatedBy   = Convert.ToInt32(Session[ApplicationSession.Userid]);
             objShiftBo.CreatedDate = DateTime.UtcNow.AddHours(5.5);
             var objResult = objShiftBl.Shift_Insert(objShiftBo, strFromTime, strToTime);
             if (objResult != null)
             {
                 if (objResult.ResultDt.Rows.Count > 0)
                 {
                     int intStatus = Convert.ToInt32(objResult.ResultDt.Rows[0]["Status"].ToString());
                     if (intStatus == 0)
                     {
                         ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('" + txtName.Text + " is already exist.');</script>");
                     }
                     else
                     {
                         ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Record Saved Successfully.');</script>");
                         ClearAll();
                         BindgvShift();
                         PanelVisibilityMode(true, false);
                     }
                 }
             }
         }
         else if (ViewState["Mode"].ToString() == "Edit")
         {
             objShiftBo.LastModifiedBy   = Convert.ToInt32(Session[ApplicationSession.Userid]);
             objShiftBo.LastModifiedDate = DateTime.UtcNow.AddHours(5.5);
             objShiftBo.ShiftId          = Convert.ToInt32(ViewState["ID"].ToString());
             var objResult = objShiftBl.Shift_Update(objShiftBo, strFromTime, strToTime);
             if (objResult != null)
             {
                 if (objResult.ResultDt.Rows.Count > 0)
                 {
                     int intStatus = Convert.ToInt32(objResult.ResultDt.Rows[0]["Status"].ToString());
                     if (intStatus == 0)
                     {
                         ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('" + txtName.Text + " is already exist.');</script>");
                     }
                     else
                     {
                         ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Record Updated Successfully.');</script>");
                         ClearAll();
                         BindgvShift();
                         PanelVisibilityMode(true, false);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         log.Error("Error", ex);
         ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical Problem. Contact to your Administrator.');</script>");
     }
 }