public ActionResult EditGoodsType(string id, string GoodsType, string GoodsTypeDesc, string MinWeight, string PremiumAmount) { if (string.IsNullOrEmpty(id)) { var entity = new SysGoodsType(); entity.GoodsType = GoodsType.Trim(); entity.GoodsTypeDesc = GoodsTypeDesc.Trim(); entity.MinWeight = Convert.ToDecimal(MinWeight.Trim()); entity.PremiumAmount = Convert.ToDecimal(PremiumAmount.Trim()); entity.CreateDate = DateTime.Now; entity.IsDelete = false; GoodsTypeService.Current.AddGoodsType(entity); } else { var entity = new SysGoodsType(); entity.Id = Convert.ToInt64(id); entity.GoodsType = GoodsType.Trim(); entity.GoodsTypeDesc = GoodsTypeDesc.Trim(); entity.MinWeight = Convert.ToDecimal(MinWeight.Trim()); entity.PremiumAmount = Convert.ToDecimal(PremiumAmount.Trim()); entity.CreateDate = DateTime.Now; GoodsTypeService.Current.UpdateGoodsType(entity); } return(Content("ok")); }
public ActionResult DeleteGoodsTypes(string[] ids) { if (ids != null) { foreach (var id in ids) { var entity = new SysGoodsType(); entity.Id = Convert.ToInt64(id); GoodsTypeService.Current.DeleteGoodsType(entity); } } return(Content("ok")); }
public int Delete(SysGoodsType entity) { try { Object result = baseDao.Delete <SysGoodsType>(entity); int iReturn = Convert.ToInt32(result); return(iReturn); } catch (Exception ex) { throw new DalException("调用ActivityDirectRules时,访问Delete时出错", ex); } }
public long Insert(SysGoodsType entity) { try { Object result = baseDao.Insert <SysGoodsType>(entity); long iReturn = Convert.ToInt64(result); return(iReturn); } catch (Exception ex) { throw new DalException("调用ActivityDirectRules时,访问Update时出错", ex); } }
public int DeleteGoodsType(SysGoodsType entity) { return(_dao.Delete(entity)); }
public int UpdateGoodsType(SysGoodsType entity) { return(_dao.Update(entity)); }
public long AddGoodsType(SysGoodsType entity) { return(_dao.Insert(entity)); }