Пример #1
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);
     }
 }
Пример #2
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);
     }
 }
Пример #3
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);
     }
 }
Пример #4
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);
 }
Пример #5
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);
     }
 }
Пример #6
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);
     }
 }