public ResponseBo Delete(ProductCategoryListBo deleteBo) { ResponseBo responseBo = new ResponseBo(); try { using (SqlConnection conn = DbAccess.Connection.GetConn()) { var p = new DynamicParameters(); base.AddStandartSpParams(ref p, deleteBo); p.Add("@Id", deleteBo.Id, DbType.Int32, ParameterDirection.Input); conn.Execute("spProductCategoryDel", p, commandType: CommandType.StoredProcedure); responseBo.Message = p.Get <string>("@Message"); responseBo.IsSuccess = p.Get <bool>("@IsSuccess"); } } catch (Exception ex) { responseBo = base.SaveExLog(ex, this.GetType(), MethodBase.GetCurrentMethod().Name, deleteBo); } return(responseBo); }
public ResponseBo Save(ProductCategoryListBo saveBo) { ResponseBo responseBo = new ResponseBo(); try { using (SqlConnection conn = DbAccess.Connection.GetConn()) { var p = new DynamicParameters(); p.Add("@Message", dbType: DbType.String, direction: ParameterDirection.Output, size: 255); p.Add("@IsSuccess", dbType: DbType.Boolean, direction: ParameterDirection.Output); p.Add("@ReturnedId", dbType: DbType.Int64, direction: ParameterDirection.Output); p.Add("@OperatorRealId", saveBo.Session.RealPerson.Id, DbType.Int64, ParameterDirection.Input); p.Add("@LanguageId", saveBo.Session.RealPerson.LanguageId, DbType.Int32, ParameterDirection.Input); p.Add("@Id", saveBo.Id, DbType.Int32, ParameterDirection.Input); p.Add("@Name", saveBo.Name, DbType.String, ParameterDirection.Input, 50); p.Add("@ParentId", saveBo.ParentId, DbType.Int32, ParameterDirection.Input); conn.Execute("spProductCategorySave", p, commandType: CommandType.StoredProcedure); responseBo.Message = p.Get <string>("@Message"); responseBo.IsSuccess = p.Get <bool>("@IsSuccess"); responseBo.ReturnedId = p.Get <long?>("@ReturnedId"); } } catch (Exception ex) { responseBo = base.SaveExLog(ex, this.GetType(), MethodBase.GetCurrentMethod().Name, saveBo); } return(responseBo); }
public ResponseDto Delete(ProductCategoryRawListDto deleteDto) { ResponseDto responseDto = new ResponseDto(); ProductCategoryListBo deleteBo = new ProductCategoryListBo() { Id = deleteDto.Id, Session = Session }; ResponseBo responseBo = productCategoryBusiness.Delete(deleteBo); responseDto = responseBo.ToResponseDto(); return(responseDto); }
public ResponseDto Save(ProductCategoryRawListDto saveDto) { ResponseDto responseDto = new ResponseDto(); ProductCategoryListBo saveBo = new ProductCategoryListBo() { Id = saveDto.Id, Name = saveDto.Name, ParentId = saveDto.ParentId, Session = Session }; ResponseBo responseBo = productCategoryBusiness.Save(saveBo); responseDto = responseBo.ToResponseDto(); return(responseDto); }