예제 #1
0
 public static bool isLegitimateData(int cableid, int salerid, DateTime endDate)
 {
     try
     {
         Commission cs = CommissionDao.FindFirst(new EqExpression("Cableid", cableid), new EqExpression("Userid", salerid),
                                                 new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中));
         if (cs != null)
         {
             if (cs.Begintime <= endDate)
             {
                 return(true);
             }
             else
             {
                 MessageHelper.ShowMessage("E031");
                 return(false);
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         MessageHelper.ShowMessage("E999", "渠道比例变更失败!");
         return(false);
     }
 }
예제 #2
0
 public static bool delSaler(int cableid, int salerid, DateTime endDate)
 {
     try
     {
         Commission c = CommissionDao.FindFirst(new EqExpression("Userid", salerid), new EqExpression("Cableid", cableid), new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中));
         if (c != null)
         {
             c.Endtime   = endDate;
             c.Isdeleted = (int)EnmIsdeleted.已删除;
             c.Update();
         }
         return(true);
     }
     catch (Exception ex)
     {
         MessageHelper.ShowMessage("E999", "删除渠道比例失败!");
         return(false);
     }
 }
예제 #3
0
 public static bool UpdataCommission(int cableId, int userId, decimal ratio, decimal tax, DateTime end, DateTime start)
 {
     try
     {
         Commission c = CommissionDao.FindFirst(new EqExpression("Cableid", cableId), new EqExpression("Userid", userId), new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中));
         if (c != null)
         {
             c.Endtime   = end;
             c.Isdeleted = (int)EnmIsdeleted.已删除;
             c.Update();
             if (!saveCommission(cableId, userId, ratio, tax, start, c.Usertype))
             {
                 return(false);
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         MessageHelper.ShowMessage("E999", ex.Message);
         return(false);
     }
 }