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;
            }
        }
Example #2
0
 internal int DeleteDrivingLicencebyId(string drivingId, string OCODE)
 {
     try
     {
         int dId = Convert.ToInt32(drivingId);
         HRM_DrivingLicencs objex = _context.HRM_DrivingLicencs.First(x => x.DrivingId == dId);
         _context.HRM_DrivingLicencs.DeleteObject(objex);
         _context.SaveChanges();
         return(1);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #3
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;
            }
        }
Example #4
0
 internal int UpdateDrivingInfo(int drivingLiceId, HRM_DrivingLicencs drivObj)
 {
     try
     {
         HRM_DrivingLicencs DrivingLicenceObj = _context.HRM_DrivingLicencs.First(x => x.DrivingId == drivingLiceId);
         DrivingLicenceObj.LicenceNo     = drivObj.LicenceNo;
         DrivingLicenceObj.Type          = drivObj.Type;
         DrivingLicenceObj.IssuedDate    = drivObj.IssuedDate;
         DrivingLicenceObj.Location      = drivObj.Location;
         DrivingLicenceObj.ExperiredDate = drivObj.ExperiredDate;
         _context.SaveChanges();
         return(1);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #5
0
 public int SaveDrivingInfo(HRM_DrivingLicencs drivObj)
 {
     _context.HRM_DrivingLicencs.AddObject(drivObj);
     _context.SaveChanges();
     return(1);
 }
 internal int UpdateDrivingInfo(int drivingLiceId, HRM_DrivingLicencs drivObj)
 {
     return(drivinLicenceInfoDal.UpdateDrivingInfo(drivingLiceId, drivObj));
 }