コード例 #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 List <Commission> Liste(String query)
 {
     try
     {
         return(CommissionDao.getListCommission(query));
     }
     catch (Exception ex)
     {
         throw new Exception("Impossible de retourner la liste des élements", ex);
     }
 }
コード例 #3
0
 public static bool Delete(long id)
 {
     try
     {
         return(CommissionDao.getDeleteCommission(id));
     }
     catch (Exception ex)
     {
         throw new Exception("Impossible de supprimer cette enregistrement", ex);
     }
 }
コード例 #4
0
 public bool Update()
 {
     try
     {
         return(CommissionDao.getUpdateCommission(commission));
     }
     catch (Exception ex)
     {
         throw new Exception("Impossible de modifier cette enregistrement", ex);
     }
 }
コード例 #5
0
 public Commission Insert()
 {
     try
     {
         return(CommissionDao.getAjoutCommission(commission));
     }
     catch (Exception ex)
     {
         throw new Exception("Impossible d'inserer cette enregistrement", ex);
     }
 }
コード例 #6
0
 public static Commission One(long id)
 {
     try
     {
         return(CommissionDao.getOneCommission(id));
     }
     catch (Exception ex)
     {
         throw new Exception("Impossible d'atteindre l'enregistrement", ex);
     }
 }
コード例 #7
0
 public static Commission[] getMainsalerAndWriterInfo(int cableId)
 {
     try
     {
         Commission[] cs = CommissionDao.FindAll(new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中), new EqExpression("Cableid", cableId));
         return(cs);
     }
     catch (Exception ex)
     {
         Log.Error(ex.Message);
         MessageHelper.ShowMessage("E999", "获取主销售和完工录入人员信息发生错误。");
         return(null);
     }
 }
コード例 #8
0
 public static Commission[] getCommissionsWithNoEndDate(int cableId)
 {
     try
     {
         Commission[] cs = CommissionDao.FindAll(new Order("Usertype", true), new EqExpression("Cableid", cableId), new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中), new NullExpression("Endtime"));
         return(cs);
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         MessageHelper.ShowMessage("E999", "获取提成信息错误。");
         return(null);
     }
 }
コード例 #9
0
 public static Commission[] getAllCommissions(int cableId)
 {
     try
     {
         Order[]      orders = { new Order("Endtime", true), new Order("Userid", true), new Order("Begintime", true) };
         Commission[] cs     = CommissionDao.FindAll(orders, new EqExpression("Cableid", cableId));
         return(cs);
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         MessageHelper.ShowMessage("E999", "获取提成信息错误。");
         return(null);
     }
 }
コード例 #10
0
 public static bool isIncludeMianandWriter(int cableid)
 {
     Commission[] cs = CommissionDao.FindAll(new EqExpression("Cableid", cableid), new OrExpression(new EqExpression("Usertype", (int)EnmDataType.完工录入), new EqExpression("Usertype", (int)EnmDataType.主销售渠道)),
                                             new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中));
     if (cs != null)
     {
         if (cs.Length == 2)
         {
             return(true);
         }
         else if (cs.Length == 0)
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #11
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);
     }
 }
コード例 #12
0
 public static bool delSaler(int cableid, DateTime endDate)
 {
     try
     {
         Commission[] cs = CommissionDao.FindAll(new EqExpression("Cableid", cableid), new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中));
         if (cs != null)
         {
             for (int i = 0; i < cs.Length; i++)
             {
                 cs[i].Endtime   = endDate;
                 cs[i].Isdeleted = (int)EnmIsdeleted.已删除;
                 cs[i].Update();
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         MessageHelper.ShowMessage("E999", "删除渠道比例失败!");
         return(false);
     }
 }
コード例 #13
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);
     }
 }
コード例 #14
0
 public static Commission[] getCommissions(int cableid, int userid)
 {
     try
     {
         if (userid == 0)
         {
             Commission[] cs = CommissionDao.FindAll(new EqExpression("Cableid", cableid), new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中));
             return(cs);
         }
         else
         {
             Commission[] cs = CommissionDao.FindAll(new EqExpression("Cableid", cableid), new EqExpression("Userid", userid), new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中));
             return(cs);
         }
         return(null);
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         MessageHelper.ShowMessage("E999", "获取提成信息错误。");
         return(null);
     }
 }