Exemplo n.º 1
0
        public static Cable getByNumberAndCustomerId(string cablenumber, int customerid)
        {
            Cable c = CableDao.FindFirst(new EqExpression("Customerid", customerid),
                                         new EqExpression("Cablenumber", cablenumber),
                                         new NotExpression(new EqExpression("Cablestatus", (int)EnmCableStatus.未完工)),
                                         new NotExpression(new EqExpression("Cablestatus", (int)EnmCableStatus.取消)),
                                         new NotExpression(new EqExpression("Cablestatus", (int)EnmCableStatus.已拆机)),
                                         new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中));

            return(c);
        }
Exemplo n.º 2
0
 public static int getCableCount(string number)
 {
     Cable[] c = CableDao.FindAll(new EqExpression("Cablenumber", number), new NotExpression(new EqExpression("Isdeleted", (int)EnmIsdeleted.已删除)));
     if (c != null)
     {
         return(c.Length);
     }
     else
     {
         return(-1);
     }
 }
Exemplo n.º 3
0
 public static Cable getCalbeByCableId(int cableid)
 {
     try
     {
         return(CableDao.FindFirst(new EqExpression("Id", cableid)));
     }
     catch (Exception ex)
     {
         Log.Error(ex.Message);
         MessageHelper.ShowMessage("E999", ex.Message);
         return(null);
     }
 }
Exemplo n.º 4
0
 public static Cable getCalbeByCableNumber(string Cablenumber)
 {
     try
     {
         return(CableDao.FindFirst(new EqExpression("Cablenumber", Cablenumber), new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中)));
     }
     catch (Exception ex)
     {
         Log.Error(ex.Message);
         MessageHelper.ShowMessage("E999", ex.Message);
         return(null);
     }
 }
Exemplo n.º 5
0
 public static Cable[] getCablesByCustomerId(int cusId)
 {
     try
     {
         if (Global.g_usergroupid == (int)EnmUserRole.销售总监)
         {
             Cable[] c = CableDao.FindAll(new Order("Createtime", false), new EqExpression("Customerid", cusId), new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中));
             return(c);
         }
         else if (Global.g_usergroupid == (int)EnmUserRole.录入人员)
         {
             Cable[] c = CableDao.FindAll(new Order("Createtime", false), new EqExpression("Customerid", cusId), new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中), new EqExpression("Controluserid", Global.g_userid));
             return(c);
         }
         return(null);
     }
     catch (Exception ex)
     {
         Log.Error(ex.Message);
         MessageHelper.ShowMessage("E999", ex.Message);
         return(null);
     }
 }
Exemplo n.º 6
0
        public static Salebills[] getBillsByCondition(int year, int month, string cable, string customername)
        {
            try
            {
                Cable[]     cb;
                Salebills[] bills;
                Customer    cus;

                if (!string.IsNullOrEmpty(cable))  //根据电路代码模糊查询
                {
                    cb = CableDao.FindAll(new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中),
                                          new NotExpression(new EqExpression("Cablestatus", (int)EnmCableStatus.未完工)),
                                          new NotExpression(new EqExpression("Cablestatus", (int)EnmCableStatus.已拆机)),
                                          new NotExpression(new EqExpression("Cablestatus", (int)EnmCableStatus.取消)),
                                          new LikeExpression("Cablenumber", "%" + cable + "%"));
                }
                else //查找全部电路代码
                {
                    cb = CableDao.FindAll(new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中),
                                          new NotExpression(new EqExpression("Cablestatus", (int)EnmCableStatus.未完工)),
                                          new NotExpression(new EqExpression("Cablestatus", (int)EnmCableStatus.已拆机)),
                                          new NotExpression(new EqExpression("Cablestatus", (int)EnmCableStatus.取消)));
                }
                if (cb != null || cb.Length > 0)
                {
                    object[] cableids = new object[cb.Length];
                    for (int i = 0; i < cb.Length; i++)
                    {
                        cableids[i] = cb[i].Id;
                    }
                    InExpression inexpress = new InExpression("Cableid", cableids);  //将所有电路代码作为查询条件

                    if (!string.IsNullOrEmpty(customername))
                    {
                        cus = CustomerBusiness.findCustomerByName(customername);
                        if (cus != null)
                        {
                            EqExpression cuseqex = new EqExpression("Customerid", cus.Id);
                            //只查正常结算和预结算的账单信息
                            bills = SalebillsDao.FindAll(new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中),
                                                         new OrExpression(new EqExpression("Flag", (int)EnmWriteOffFlag.正常结算), new EqExpression("Flag", (int)EnmWriteOffFlag.预结算)),
                                                         new EqExpression("Year", year),
                                                         new EqExpression("Month", month),
                                                         inexpress, cuseqex);
                        }
                        else
                        {
                            //只查正常结算和预结算的账单信息
                            bills = SalebillsDao.FindAll(new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中),
                                                         new OrExpression(new EqExpression("Flag", (int)EnmWriteOffFlag.正常结算), new EqExpression("Flag", (int)EnmWriteOffFlag.预结算)),
                                                         new EqExpression("Year", year),
                                                         new EqExpression("Month", month),
                                                         inexpress);
                        }
                    }
                    else
                    {
                        //只查正常结算和预结算的Excel账单信息
                        bills = SalebillsDao.FindAll(new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中),
                                                     new OrExpression(new EqExpression("Flag", (int)EnmWriteOffFlag.正常结算), new EqExpression("Flag", (int)EnmWriteOffFlag.预结算)),
                                                     new EqExpression("Year", year),
                                                     new EqExpression("Month", month),
                                                     inexpress);
                    }
                    return(bills);
                }

                return(null);
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message);
                MessageHelper.ShowMessage("E999", ex.Message);
                return(null);
            }
        }
Exemplo n.º 7
0
 public static Cable[] getByCondition()
 {
     Cable[] cs = CableDao.FindAll(new Order("Default2", true), new NotNullExpression("Default2"), new NotExpression(new EqExpression("Default2", "")), new EqExpression("Isdeleted", (int)EnmIsdeleted.使用中));
     return(cs);
 }