Ejemplo n.º 1
0
        protected void btnDrivingLicence_Click(object sender, EventArgs e)
        {
            DrivingLicenceInfoBLL drivingLicenceBLL = new DrivingLicenceInfoBLL();

            try
            {
                HRM_DrivingLicencs drivObj = new HRM_DrivingLicencs();
                drivObj.EID           = Convert.ToString(Session["EID"]);
                drivObj.LicenceNo     = txtbxLicenNo.Text;
                drivObj.Type          = drpdwnDriveType.SelectedItem.ToString();
                drivObj.IssuedDate    = Convert.ToDateTime(txtbxIssUedDate.Text);
                drivObj.ExperiredDate = Convert.ToDateTime(txtbxExperiredDate.Text);
                drivObj.Location      = txtbxLocation.Text;
                drivObj.EDIT_DATE     = DateTime.Now;
                drivObj.EDIT_USER     = ((SessionUser)Session["SessionUser"]).UserId;
                drivObj.OCODE         = ((SessionUser)Session["SessionUser"]).OCode;

                int result = drivingLicenceBLL.SaveDrivingInfo(drivObj);
                if (result == 1)
                {
                    ClearDrivingLicenceText();
                    //lblDrivingMessage.Text = "Data Save Successfully";
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Save successfully!')", true);
                    getDrivingLicence();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        protected void btnDrivingSumbiandUpdate_Click(object sender, EventArgs e)
        {
            DrivingLicenceInfoBLL drivingLicenceBLL = new DrivingLicenceInfoBLL();

            try
            {
                HRM_DrivingLicencs drivObj = new HRM_DrivingLicencs();
                // drivObj.EID = Convert.ToString(Session["EID"]);

                drivObj.LicenceNo     = txtbxLiceNo.Text;
                drivObj.Type          = drpdwnDriveType.SelectedItem.ToString();
                drivObj.IssuedDate    = Convert.ToDateTime(txtbxIssuedDate.Text);
                drivObj.ExperiredDate = Convert.ToDateTime(txtbxDexperiredDate.Text);
                drivObj.Location      = txtbxLocation.Text;

                if (btnDrivingSumbiandUpdate.Text == "Submit")
                {
                    drivObj.EID       = Convert.ToString(Session["EID"]);
                    drivObj.EDIT_DATE = DateTime.Now;
                    drivObj.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId;
                    drivObj.OCODE     = ((SessionUser)Session["SessionUser"]).OCode;

                    int result = drivingLicenceBLL.SaveDrivingInfo(drivObj);
                    if (result == 1)
                    {
                        ClearDrivingLicence();
                        lblDrivingLicenMessage.Text = "Data Save Successfully";
                        getDrivingLicence();
                    }
                }
                else
                {
                    int drivingLiceId = Convert.ToInt32(hidDivrIngLicenceId.Value);
                    int result        = drivingLicenceBLL.UpdateDrivingInfo(drivingLiceId, drivObj);
                    if (result == 1)
                    {
                        ClearDrivingLicence();
                        lblDrivingLicenMessage.Text = "Data Update Successfully";
                        getDrivingLicence();
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }