示例#1
0
 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"));
 }
示例#2
0
 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"));
 }
示例#3
0
 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);
     }
 }
示例#4
0
 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);
     }
 }
示例#5
0
 public int DeleteGoodsType(SysGoodsType entity)
 {
     return(_dao.Delete(entity));
 }
示例#6
0
 public int UpdateGoodsType(SysGoodsType entity)
 {
     return(_dao.Update(entity));
 }
示例#7
0
 public long AddGoodsType(SysGoodsType entity)
 {
     return(_dao.Insert(entity));
 }