internal int UpdateLatterFormate(HRM_LETTER_FORMAT latterForObj, int latterId)
        {
            HRM_LETTER_FORMAT latterFormateObj = _context.HRM_LETTER_FORMAT.First(x => x.LTR_ID == latterId);

            latterForObj.LTR_Title       = latterForObj.LTR_Title;
            latterForObj.LTR_Type        = latterForObj.LTR_Type;
            latterFormateObj.LTR_Details = latterForObj.LTR_Details;
            latterFormateObj.EDIT_DATE   = latterForObj.EDIT_DATE;
            latterFormateObj.EDIT_USER   = latterForObj.EDIT_USER;
            latterFormateObj.OCODE       = latterForObj.OCODE;
            _context.SaveChanges();
            return(1);
        }
 internal int SaveLatterFormate(HRM_LETTER_FORMAT latterForObj)
 {
     try
     {
         _context.HRM_LETTER_FORMAT.AddObject(latterForObj);
         _context.SaveChanges();
         return(1);
     }
     catch (Exception)
     {
         throw;
     }
 }
 protected void btnLetterFormate_Click(object sender, EventArgs e)
 {
     try
     {
         HRM_LETTER_FORMAT latterForObj = new HRM_LETTER_FORMAT();
         latterForObj.LTR_Title   = txtTitle.Text;
         latterForObj.LTR_Type    = Convert.ToInt32(drpType.SelectedValue);
         latterForObj.LTR_Details = txtLatterDetails.Text;
         latterForObj.EDIT_USER   = ((SessionUser)Session["SessionUser"]).UserId;
         latterForObj.EDIT_DATE   = DateTime.Now;
         latterForObj.OCODE       = ((SessionUser)Session["SessionUser"]).OCode;
         if (btnLetterFormate.Text == "Submit")
         {
             int result = latterFormateBll.SaveLatterFormate(latterForObj);
             if (result == 1)
             {
                 lblMessage.Text    = "Data Save Successfully";
                 pnl_result.Visible = true;
                 ClearAllControll();
             }
         }
         else
         {
             int latterId = Convert.ToInt32(hidLatterFormateId.Value);
             int result   = latterFormateBll.UpdateLatterFormate(latterForObj, latterId);
             if (result == 1)
             {
                 lblMessage.Text    = "Data Update Successfully";
                 pnl_result.Visible = true;
                 ClearAllControll();
             }
         }
         ClearAllControll();
         getLatterFormates();
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
     }
 }
Exemple #4
0
 internal int UpdateLatterFormate(HRM_LETTER_FORMAT latterForObj, int latterId)
 {
     return(latterFormateDal.UpdateLatterFormate(latterForObj, latterId));
 }
Exemple #5
0
 internal int SaveLatterFormate(HRM_LETTER_FORMAT latterForObj)
 {
     return(latterFormateDal.SaveLatterFormate(latterForObj));
 }