public int Update(CmsSociety model) { return((int)SqlHelper.ExecuteScalar(SqlConnection, CommonHelper.Config.GetFullyQualifiedName("CmsSociety_Update") , model.Id, CommonHelper.Null.GetNull(model.Type), CommonHelper.Null.GetNull(model.Name), CommonHelper.Null.GetNull(model.Link) , model.Orders, model.UsedState, model.CreatedBy, model.CreatedDate, CommonHelper.Null.GetNull(model.ModifiedDate), CommonHelper.Null.GetNull(model.ModifiedBy))); }
public int Insert(CmsSociety model) { var deciResult = SqlHelper.ExecuteScalar(SqlConnection, CommonHelper.Config.GetFullyQualifiedName("CmsSociety_Insert") , CommonHelper.Null.GetNull(model.Type), CommonHelper.Null.GetNull(model.Name), CommonHelper.Null.GetNull(model.Link) , model.Orders, model.UsedState, model.CreatedBy, model.CreatedDate, CommonHelper.Null.GetNull(model.ModifiedDate), CommonHelper.Null.GetNull(model.ModifiedBy)); return(CommonHelper.Convert.ConvertToInt32(deciResult)); }
public ActionResult Edit(CmsSociety sysModel) { try { #region Redirect Request int succcess = 0; if (sysModel.Id > 0) { var objTemporary = _sysAction.GetById(sysModel.Id); if (AuthorizeUser.IsAction(Ultity.Constant.Edit) || AuthorizeUser.IsAction(Ultity.Constant.ViewEditAll)) { sysModel.CreatedBy = objTemporary.CreatedBy; sysModel.ModifiedDate = DateTime.Now; sysModel.ModifiedBy = WebSecurity.CurrentUserId; sysModel.CreatedDate = objTemporary.CreatedDate; succcess = _sysAction.Update(sysModel); } else { succcess = 1; } } else { if (AuthorizeUser.IsAction(Ultity.Constant.Add) || AuthorizeUser.IsAction(Ultity.Constant.ViewEditAll)) { sysModel.CreatedBy = WebSecurity.CurrentUserId; sysModel.ModifiedBy = null; sysModel.CreatedDate = DateTime.Now; sysModel.ModifiedDate = null; succcess = _sysAction.Insert(sysModel); } else { succcess = 1; } } if (succcess > 0) { return(Json(new { status = "success", Message = Ultity.Constant.Ajax_Success })); } return(Json(new { status = "fail", Message = Ultity.Constant.Ajax_Fail })); #endregion Redirect Request } catch (Exception exception) { Ultity.TFunction.WriteToLog(exception); } return(Json(new { status = "fail", Message = Ultity.Constant.Ajax_Fail })); }
public ActionResult GetById(int?id) { var objTemporary = new CmsSociety(); try { int editId = id.HasValue ? id.Value : 0; if (editId > 0) { objTemporary = _sysAction.GetById(editId); } return(Json(new { status = "success", Message = Ultity.Constant.Ajax_Success, Data = objTemporary })); } catch (Exception exception) { Ultity.TFunction.WriteToLog(exception); return(Json(new { status = "fail", Message = Ultity.Constant.Ajax_Fail })); } }