public ActionResult SaveEmailMaster(EmailMasterModel model) { model.UserId = SessionHelper.UserId; var result = objEmailService.AddEditEmailMaster(model); return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult OpenEmailMasterPopUp(int EmailId = 0) { BindLanguageList(); EmailMasterModel objModel = new EmailMasterModel(); if (EmailId > 0) { EmailMasterModel result = new EmailMasterModel(); result = objEmailService.GetEmailMasterByEmailId(EmailId); objModel = result; } return(View(ViewHelper.AddEditEmail, objModel)); }
public EmailMasterModel GetEmailMasterByEmailId(int EmailId) { GenericRepository <EmailMasterModel> objGenericRepository = new GenericRepository <EmailMasterModel>(); EmailMasterModel Result = new EmailMasterModel(); try { Result = objGenericRepository.ExecuteSQL <EmailMasterModel>("sp_GetEmailMasterByEmailId @EmailId", Utility.GetSQLParam("EmailId", SqlDbType.Int, EmailId) ).FirstOrDefault(); } catch (Exception ex) { } return(Result); }
public string AddEditEmailMaster(EmailMasterModel model) { GenericRepository <EmailMasterModel> objGenericRepository = new GenericRepository <EmailMasterModel>(); string Result = string.Empty; try { Result = objGenericRepository.ExecuteSQL <string>("sp_AddEditEmailMaster @EmailId,@LanguageId,@Email,@UserId", Utility.GetSQLParam("EmailId", SqlDbType.Int, model.EmailId), Utility.GetSQLParam("LanguageId", SqlDbType.Int, model.LanguageId), Utility.GetSQLParam("Email", SqlDbType.VarChar, !string.IsNullOrWhiteSpace(model.Email) ? model.Email : (object)DBNull.Value), Utility.GetSQLParam("UserId", SqlDbType.Int, model.UserId) ).FirstOrDefault(); } catch (Exception ex) { Result = ex.Message.ToString(); } return(Result); }