Beispiel #1
0
        public List <RoleInfo> GetRolesByRule(string name, int status)
        {
            List <RoleInfo> result  = new List <RoleInfo>();
            string          sqlText = RoleStatement.GetAllRolesByRule;

            if (!string.IsNullOrEmpty(name))
            {
                sqlText += " AND RoleName LIKE '%'+@key+'%'";
            }
            if (status > -1)
            {
                sqlText += " AND Status=@Status";
            }


            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(sqlText, "Text"));

            if (!string.IsNullOrEmpty(name))
            {
                command.AddInputParameter("@key", DbType.String, name);
            }
            if (status > -1)
            {
                command.AddInputParameter("@Status", DbType.Int32, status);
            }

            result = command.ExecuteEntityList <RoleInfo>();
            return(result);
        }
Beispiel #2
0
        public List <StorageLocationInfo> GetSubAreaNoByStorageAreaNo(string StorageAreaNo, int status)
        {
            List <StorageLocationInfo> result = new List <StorageLocationInfo>();
            string sqlText = StorageLocationStatement.GetSubAreaNo;

            if (!string.IsNullOrEmpty(StorageAreaNo))
            {
                sqlText += " AND StorageAreaNo=@StorageAreaNo";
            }
            if (status > -1)
            {
                sqlText += " AND Status=@Status";
            }

            sqlText += " ORDER BY StorageSubAreaNo";

            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(sqlText, "Text"));

            if (!string.IsNullOrEmpty(StorageAreaNo))
            {
                command.AddInputParameter("@StorageAreaNo", DbType.String, StorageAreaNo);
            }
            if (status > -1)
            {
                command.AddInputParameter("@Status", DbType.Int32, status);
            }

            result = command.ExecuteEntityList <StorageLocationInfo>();
            return(result);
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="UnionType"></param>
        /// <param name="UnionID"></param>
        /// <returns></returns>
        public List <ContactInfo> GetContactsByRule(string UnionType, int UnionID)
        {
            List <ContactInfo> result  = new List <ContactInfo>();
            string             sqlText = ContactStatement.GetAllContactByRule;

            if (!string.IsNullOrEmpty(UnionType))
            {
                sqlText += " AND UnionType =@UnionType";
            }
            if (UnionID > -1)
            {
                sqlText += " AND UnionID=@UnionID";
            }
            sqlText += " AND Status=@Status";

            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(sqlText, "Text"));

            if (!string.IsNullOrEmpty(UnionType))
            {
                command.AddInputParameter("@UnionType", DbType.String, UnionType);
            }
            if (UnionID > -1)
            {
                command.AddInputParameter("@UnionID", DbType.Int32, UnionID);
            }
            command.AddInputParameter("@Status", DbType.Int32, 1);

            result = command.ExecuteEntityList <ContactInfo>();
            return(result);
        }
Beispiel #4
0
        public List <LineInfo> GetLineInfoByRule(int LineID, PagerInfo pager)
        {
            List <LineInfo> result = new List <LineInfo>();

            StringBuilder builder = new StringBuilder();

            if (LineID > -1)
            {
                builder.Append(" AND LineID=@LineID");
            }
            string sqlText = LineStatement.GetAllLineInfoByRulePagerHeader + builder.ToString() + LineStatement.GetAllLineInfoByRulePagerFooter;

            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(sqlText, "Text"));

            if (LineID > -1)
            {
                command.AddInputParameter("@LineID", DbType.Int32, LineID);
            }
            command.AddInputParameter("@PageIndex", DbType.Int32, pager.PageIndex);
            command.AddInputParameter("@PageSize", DbType.Int32, pager.PageSize);
            command.AddInputParameter("@recordCount", DbType.Int32, pager.SumCount);

            result = command.ExecuteEntityList <LineInfo>();
            return(result);
        }
Beispiel #5
0
        public int GetOrderDeliverPlanCount(int carrierID, string begindate, string enddate)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(OrderDeliverPlanStatement.GetCount);
            if (carrierID > -1)
            {
                builder.Append(" AND CarrierID=@CarrierID");
            }
            if (!string.IsNullOrEmpty(begindate) && !string.IsNullOrEmpty(enddate))
            {
                builder.Append(" AND DeliverDate BETWEEN @begindate AND @enddate ");
            }
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(builder.ToString(), "Text"));

            if (carrierID > -1)
            {
                command.AddInputParameter("@CarrierID", DbType.Int32, carrierID);
            }
            if (!string.IsNullOrEmpty(begindate) && !string.IsNullOrEmpty(enddate))
            {
                command.AddInputParameter("@begindate", DbType.String, begindate);
                command.AddInputParameter("@enddate", DbType.String, enddate);
            }
            var o = command.ExecuteScalar <object>();

            return(Convert.ToInt32(o));
        }
Beispiel #6
0
        public List <StoreInfo> GetStoresByRule(string name, int status, PagerInfo pager)
        {
            List <StoreInfo> result  = new List <StoreInfo>();
            StringBuilder    builder = new StringBuilder();


            if (!string.IsNullOrEmpty(name))
            {
                builder.Append(" AND SupplierName LIKE '%'+@key+'%'");
            }
            if (status > -1)
            {
                builder.Append(" AND Status=@Status");
            }

            string sqlText = StoreStatement.GetAllStoreInfoByRulePagerHeader + builder.ToString() + StoreStatement.GetAllStoreInfoByRulePagerFooter;

            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(sqlText, "Text"));

            if (!string.IsNullOrEmpty(name))
            {
                command.AddInputParameter("@key", DbType.String, name);
            }
            if (status > -1)
            {
                command.AddInputParameter("@Status", DbType.Int32, status);
            }
            command.AddInputParameter("@PageIndex", DbType.Int32, pager.PageIndex);
            command.AddInputParameter("@PageSize", DbType.Int32, pager.PageSize);
            command.AddInputParameter("@recordCount", DbType.Int32, pager.SumCount);

            result = command.ExecuteEntityList <StoreInfo>();
            return(result);
        }
Beispiel #7
0
        public List <StorageLocationInfo> GetAreaNoByStorageID(int storageID, int status)
        {
            List <StorageLocationInfo> result = new List <StorageLocationInfo>();
            string sqlText = StorageLocationStatement.GetAreaNo;

            if (storageID > 0)
            {
                sqlText += " AND storageID=@storageID";
            }
            if (status > -1)
            {
                sqlText += " AND Status=@Status";
            }

            sqlText += " ORDER BY StorageAreaNo";


            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(sqlText, "Text"));

            if (storageID > 0)
            {
                command.AddInputParameter("@storageID", DbType.Int32, storageID);
            }
            if (status > -1)
            {
                command.AddInputParameter("@Status", DbType.Int32, status);
            }

            result = command.ExecuteEntityList <StorageLocationInfo>();
            return(result);
        }
Beispiel #8
0
        public int GetStoreCount(string name, int status)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(StoreStatement.GetStoreCount);
            if (!string.IsNullOrEmpty(name))
            {
                builder.Append(" AND SupplierName LIKE '%'+@key+'%'");
            }
            if (status > -1)
            {
                builder.Append(" AND Status=@Status");
            }
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(builder.ToString(), "Text"));

            if (!string.IsNullOrEmpty(name))
            {
                command.AddInputParameter("@key", DbType.String, name);
            }
            if (status > -1)
            {
                command.AddInputParameter("@Status", DbType.Int32, status);
            }


            var o = command.ExecuteScalar <object>();

            return(Convert.ToInt32(o));
        }
Beispiel #9
0
        public int EditOrderStatus(long oid, int status)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(OrderStatement.EditOrderStatus, "Text"));

            command.AddInputParameter("@OrderInnerID", DbType.Int64, oid);
            command.AddInputParameter("@Status", DbType.Int32, status);
            return(command.ExecuteNonQuery());
        }
Beispiel #10
0
        /// <summary>
        /// 更新下载(接单)状态
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public int UpdateUploadStatus(OrderInfo order)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(OrderStatement.UpdateUploadStatus, "Text"));

            command.AddInputParameter("@UploadStatus", DbType.Int32, order.UploadStatus);
            command.AddInputParameter("@OrderID", DbType.Int32, order.OrderID);
            return(command.ExecuteNonQuery());
        }
Beispiel #11
0
        /// <summary>
        /// 更新配送时间
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public int UpdateOrderArriverDate(OrderInfo order)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(OrderStatement.UpdateOrderArriverDate, "Text"));

            command.AddInputParameter("@ArriverDate", DbType.DateTime, order.ArriverDate);
            command.AddInputParameter("@OrderID", DbType.Int32, order.OrderID);
            return(command.ExecuteNonQuery());
        }
Beispiel #12
0
        /// <summary>
        /// 获取我的租赁/试驾信息
        /// </summary>
        /// <param name="userid">用户ID</param>
        /// <param name="RType">ZL:汽车租赁 SJ:汽车试驾</param>
        /// <returns></returns>
        public DataSet MyReservation(string userid, string RType)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(CarStatement.MyReservation, "Text"));

            command.AddInputParameter("@CustomerID", DbType.String, userid);
            command.AddInputParameter("@RType", DbType.String, RType);
            return(command.ExecuteDataSet());
        }
Beispiel #13
0
        /// <summary>
        ///  修改密码
        /// </summary>
        /// <param name="telephone"></param>
        /// <param name="password"></param>
        /// <param name="vcode"></param>
        /// <returns></returns>

        public int UpdatePassword(string telephone, string password, string vcode)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(CustomerStatement.UpdatePassword, "Text"));

            command.AddInputParameter("@CustomerCode", DbType.String, vcode);
            command.AddInputParameter("@Password", DbType.String, password);
            command.AddInputParameter("@Mobile", DbType.String, telephone);
            return(command.ExecuteNonQuery());
        }
Beispiel #14
0
        public int ModifyInventoryQuantity(InventoryInfo Inventory)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(InventoryStatement.ModifyInventoryQuantity, "Text"));

            command.AddInputParameter("@Quantity", DbType.Int32, Inventory.Quantity);
            command.AddInputParameter("@ChangeDate", DbType.DateTime, Inventory.ChangeDate);
            command.AddInputParameter("@InventoryID", DbType.Int64, Inventory.InventoryID);
            return(command.ExecuteNonQuery());
        }
Beispiel #15
0
        public int ModifyPassword(long userid, string password)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(UserStatement.ModifyPassword, "Text"));

            command.AddInputParameter("@UserID", DbType.Int64, userid);
            command.AddInputParameter("@Password", DbType.String, password);

            return(command.ExecuteNonQuery());
        }
Beispiel #16
0
        public int GetInventoryDetailCount(string name, string inventoryType, int StorageID, int customerID, string inventoryDate, string orderType)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(InventoryDetailStatement.GetCount);
            if (!string.IsNullOrEmpty(name))
            {
            }
            if (!string.IsNullOrEmpty(inventoryType))
            {
                builder.Append(" AND inventoryType=@inventoryType");
            }
            if (StorageID > 0)
            {
                builder.Append(" AND StorageID=@StorageID");
            }
            if (customerID > 0)
            {
                builder.Append(" AND customerID=@customerID");
            }
            if (!string.IsNullOrEmpty(orderType))
            {
                builder.Append(" AND orderType=@orderType");
            }

            builder.Append(" AND Quantity>0 ");//库存数量必须大于0

            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(builder.ToString(), "Text"));

            if (!string.IsNullOrEmpty(name))
            {
            }
            if (!string.IsNullOrEmpty(inventoryType))
            {
                command.AddInputParameter("@inventoryType", DbType.String, inventoryType);
            }
            if (StorageID > 0)
            {
                command.AddInputParameter("@StorageID", DbType.Int32, StorageID);
            }
            if (customerID > 0)
            {
                command.AddInputParameter("@customerID", DbType.Int32, customerID);
            }
            if (!string.IsNullOrEmpty(inventoryDate))
            {
            }
            if (!string.IsNullOrEmpty(orderType))
            {
                command.AddInputParameter("@orderType", DbType.String, orderType);
            }

            var o = command.ExecuteScalar <object>();

            return(Convert.ToInt32(o));
        }
Beispiel #17
0
        /// <summary>
        /// 相同产品ID、相同批次号
        /// </summary>
        /// <param name="goodsid"></param>
        /// <param name="storageID"></param>
        /// <param name="batchNumber"></param>
        /// <param name="DY0">是否查询大于0</param>
        /// <returns></returns>
        public List <InventoryInfo> GetInventoryByRule(int goodsid, int storageID, string batchNumber, int CustomerID, bool DY0, string keywords)
        {
            List <InventoryInfo> result = new List <InventoryInfo>();
            string sqlText = InventoryStatement.GetAllInventoryByRule;

            if (!string.IsNullOrEmpty(keywords))
            {
                sqlText += " and GoodsID in(select GoodsID from wms_GoodsInfo where GoodsName like '%" + keywords + "%')";
            }
            if (goodsid > 0)
            {
                sqlText += " AND GoodsID=@GoodSID";
            }
            if (storageID > 0)
            {
                sqlText += " AND StorageID=@StorageID";
            }
            if (!string.IsNullOrEmpty(batchNumber))
            {
                sqlText += " AND BatchNumber=@BatchNumber";
            }

            if (CustomerID > 0)
            {
                sqlText += " AND CustomerID=@CustomerID";
            }

            // 只查询大于0的库存数据
            if (DY0)
            {
                sqlText += " AND Quantity>0";
            }

            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(sqlText, "Text"));

            if (goodsid > 0)
            {
                command.AddInputParameter("@GoodSID", DbType.String, goodsid);
            }
            if (storageID > 0)
            {
                command.AddInputParameter("@StorageID", DbType.String, storageID);
            }
            if (!string.IsNullOrEmpty(batchNumber))
            {
                command.AddInputParameter("@BatchNumber", DbType.String, batchNumber);
            }

            if (CustomerID > 0)
            {
                command.AddInputParameter("@CustomerID", DbType.String, CustomerID);
            }

            result = command.ExecuteEntityList <InventoryInfo>();
            return(result);
        }
Beispiel #18
0
        /// <summary>
        /// 更新库位状态(是否锁定T/F)
        /// </summary>
        /// <param name="StorageLocationID"></param>
        /// <returns></returns>
        public int ModifyLock(long StorageLocationID, string isLock)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(StorageLocationStatement.ModifyLock, "Text"));

            command.AddInputParameter("@StorageLocationID", DbType.Int64, StorageLocationID);
            command.AddInputParameter("@IsLock", DbType.String, isLock);
            int result = command.ExecuteNonQuery();

            return(result);
        }
Beispiel #19
0
        /// <summary>
        ///  登录验证
        /// </summary>
        /// <param name="telephone"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public CustomerInfo Login(string telephone, string password)
        {
            CustomerInfo result  = new CustomerInfo();
            DataCommand  command = new DataCommand(ConnectionString, GetDbCommand(CustomerStatement.LoginSql, "Text"));

            command.AddInputParameter("@Mobile", DbType.String, telephone);
            command.AddInputParameter("@password", DbType.String, password);
            result = command.ExecuteEntity <CustomerInfo>();
            return(result);
        }
Beispiel #20
0
        /// <summary>
        /// 更新承运商信息
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public int UpdateOrderCarrier(OrderInfo order)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(OrderStatement.UpdateOrderCarrier, "Text"));

            command.AddInputParameter("@CarrierID", DbType.Int32, order.CarrierID);
            command.AddInputParameter("@PlanID", DbType.Int32, order.PlanID);
            command.AddInputParameter("@DeliveryStatus", DbType.String, order.DeliveryStatus);//是否安排物流计划  T是/F否
            command.AddInputParameter("@OrderID", DbType.Int32, order.OrderID);
            return(command.ExecuteNonQuery());
        }
Beispiel #21
0
        public int ModifyPileNum(int num, int bid)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(ChargeStatement.ModifyPileNum, "Text"));

            command.AddInputParameter("@ChargeNum", DbType.Int32, num);
            command.AddInputParameter("@ChargeBaseID", DbType.Int32, bid);
            int result = command.ExecuteNonQuery();

            return(result);
        }
Beispiel #22
0
        /// <summary>
        /// 判断手机号 VCODE 是否有效
        /// </summary>
        /// <param name="telephone"></param>
        /// <param name="vcode"></param>
        /// <returns></returns>
        public VerificationCodeInfo CheckVerificationCode(string telephone, string vcode)
        {
            VerificationCodeInfo result  = new VerificationCodeInfo();
            DataCommand          command = new DataCommand(ConnectionString, GetDbCommand(BaseDataStatement.CheckVerificationCodeSql, "Text"));

            command.AddInputParameter("@Mobile", DbType.String, telephone);
            command.AddInputParameter("@VCode", DbType.String, vcode);
            result = command.ExecuteEntity <VerificationCodeInfo>();
            return(result);
        }
Beispiel #23
0
        public UserInfo GetLoginUser(string name, string password)
        {
            UserInfo    result  = new UserInfo();
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(UserStatement.GetLoginUser, "Text"));

            command.AddInputParameter("@UserName", DbType.String, name);
            command.AddInputParameter("@Password", DbType.String, password);
            result = command.ExecuteEntity <UserInfo>();
            return(result);
        }
Beispiel #24
0
        public List <StoreInfo> GetAllStorePager(PagerInfo pager)
        {
            List <StoreInfo> result  = new List <StoreInfo>();
            DataCommand      command = new DataCommand(ConnectionString, GetDbCommand(StoreStatement.GetAllStorePager, "Text"));

            command.AddInputParameter("@PageIndex", DbType.Int32, pager.PageIndex);
            command.AddInputParameter("@PageSize", DbType.Int32, pager.PageSize);
            command.AddInputParameter("@recordCount", DbType.Int32, pager.SumCount);
            result = command.ExecuteEntityList <StoreInfo>();
            return(result);
        }
Beispiel #25
0
        public int ModifyRole(RoleInfo role)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(RoleStatement.ModifyRole, "Text"));

            command.AddInputParameter("@RoleID", DbType.Int32, role.RoleID);
            command.AddInputParameter("@RoleName", DbType.String, role.RoleName);
            command.AddInputParameter("@MenuIDs", DbType.String, role.MenuIDs);
            command.AddInputParameter("@Status", DbType.Int32, role.Status);

            return(command.ExecuteNonQuery());
        }
Beispiel #26
0
        public int ModifyCustomer(CustomerInfo customerInfo)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(CustomerStatement.ModifyCustomer, "Text"));

            command.AddInputParameter("@CustomerID", DbType.Int64, customerInfo.CustomerID);
            command.AddInputParameter("@CustomerName", DbType.String, customerInfo.CustomerName);
            command.AddInputParameter("@Name", DbType.String, customerInfo.Name);
            command.AddInputParameter("@Mobile", DbType.String, customerInfo.Mobile);
            command.AddInputParameter("@WXCode", DbType.String, customerInfo.WXCode);
            return(command.ExecuteNonQuery());
        }
Beispiel #27
0
        public int CreateNew(BrandInfo brand)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(BrandStatement.CreateBrand, "Text"));

            command.AddInputParameter("@BrandName", DbType.String, brand.BrandName);
            command.AddInputParameter("@BrandNameEN", DbType.String, brand.BrandNameEN);
            command.AddInputParameter("@ImageURL", DbType.String, brand.ImageURL);
            command.AddInputParameter("@Description", DbType.String, brand.Description);
            command.AddInputParameter("@IsUse", DbType.Int32, brand.IsUse);
            return(command.ExecuteNonQuery());
        }
Beispiel #28
0
        public int ModifyGroup(GroupInfo group)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(GroupStatement.ModifyGroup, "Text"));

            command.AddInputParameter("@GroupID", DbType.Int64, group.GroupID);
            command.AddInputParameter("@GroupName", DbType.String, group.GroupName);
            command.AddInputParameter("@MenuIDs", DbType.String, group.MenuIDs);
            command.AddInputParameter("@Status", DbType.Int32, group.Status);

            return(command.ExecuteNonQuery());
        }
Beispiel #29
0
        public int CreateNew(GroupInfo group)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(GroupStatement.CreateNewGroup, "Text"));

            command.AddInputParameter("@GroupName", DbType.String, group.GroupName);
            command.AddInputParameter("@MenuIDs", DbType.String, group.MenuIDs);
            command.AddInputParameter("@Status", DbType.Int32, group.Status);
            command.AddInputParameter("@CreateDate", DbType.DateTime, group.CreateDate);

            return(command.ExecuteNonQuery());
        }
Beispiel #30
0
        public int ModifyAdviseDealInfo(AdviseInfo adviseInfo)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(AdviseStatement.DealAdviseInfo, "Text"));

            command.AddInputParameter("@AdviseID", DbType.Int64, adviseInfo.AdviseID);
            command.AddInputParameter("@DealStatus", DbType.Int32, adviseInfo.DealStatus);
            command.AddInputParameter("@DealSummary", DbType.String, adviseInfo.DealSummary);
            command.AddInputParameter("@Operator", DbType.Int64, adviseInfo.Operator);
            command.AddInputParameter("@ModifyDate", DbType.DateTime, adviseInfo.ModifyDate);

            return(command.ExecuteNonQuery());
        }