Beispiel #1
0
        private int GetOverDays(string serialNumber, int goodsID, out decimal goodsPrice, out int stockCount)
        {
            //计算距离过期时间
            GoodsBaseInfo bInfo = new GoodsBaseInfo();

            bInfo.SerialNumber = serialNumber;
            OQL q = OQL.From(bInfo)
                    .Select(bInfo.CanUserMonth)
                    .Where(bInfo.SerialNumber)
                    .END;

            bInfo = EntityQuery <GoodsBaseInfo> .QueryObject(q);

            int canUseMonth = bInfo.CanUserMonth;

            GoodsStock stock = new GoodsStock();

            stock.GoodsID = goodsID;
            EntityQuery <GoodsStock> .Fill(stock);

            goodsPrice = stock.GoodsPrice;
            stockCount = stock.Stocks;
            //距离过期时间
            int overDays = canUseMonth * 30 - DateTime.Now.Subtract(stock.MakeOnDate).Days;

            return(overDays);
        }
Beispiel #2
0
        public static T GetModelB <T>(string ID) where T : EntityBase, IStringID, new()
        {
            T model = new T();

            model.ID = ID;
            return(EntityQuery <T> .Fill(model) ? model : null);
        }
 /// <summary>
 /// 查 根据Id获取详情,如果没有则返回空对象
 /// </summary>
 /// <param name="customerID"></param>
 /// <returns></returns>
 public BankAccountModel GetModelById(int accountId)
 {
     BankAccountModel model = new BankAccountModel() { ID = accountId };
     if (EntityQuery<BankAccountModel>.Fill(model))
         return model;
     else
         return null;
 }
Beispiel #4
0
        /// <summary>
        /// 获取一条商品信息
        /// </summary>
        /// <param name="sn">条码号</param>
        /// <returns></returns>
        public GoodsBaseInfo GetGoodsBaseInfo(string sn)
        {
            GoodsBaseInfo info = new GoodsBaseInfo()
            {
                SerialNumber = sn
            };

            EntityQuery <GoodsBaseInfo> .Fill(info);

            return(info);
        }
        /// <summary>
        /// 使用用户名密码参数来登录,但是根据实体类的主键来填充实体类并判断是否成功。
        /// </summary>
        /// <param name="name"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public bool Login6(string name, string pwd)
        {
            User user = new User();
            user.PrimaryKeys.Clear();
            user.PrimaryKeys.Add("Name");
            user.PrimaryKeys.Add("Pwd");

            user.Name = name;
            user.Pwd = pwd;
            bool result= EntityQuery<User>.Fill(user);//静态方法,使用默认的连接对象
            return result;
        }
Beispiel #6
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="customerID"></param>
        /// <returns></returns>
        public AdminAccount GetModelById(int accountId)
        {
            AdminAccount model = new AdminAccount()
            {
                ID = accountId
            };

            if (EntityQuery <AdminAccount> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #7
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="MerchanterID"></param>
        /// <returns></returns>
        public MerchantTypeModel GetModelById(int accountId)
        {
            MerchantTypeModel model = new MerchantTypeModel()
            {
                ID = accountId
            };

            if (EntityQuery <MerchantTypeModel> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #8
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="customerID"></param>
        /// <returns></returns>
        public BankModel GetModelById(int accountId)
        {
            BankModel model = new BankModel()
            {
                ID = accountId
            };

            if (EntityQuery <BankModel> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #9
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="TicketerID"></param>
        /// <returns></returns>
        public TicketInfo GetModelById(int accountId)
        {
            TicketInfo model = new TicketInfo()
            {
                ID = accountId
            };

            if (EntityQuery <TicketInfo> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #10
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="customerID"></param>
        /// <returns></returns>
        public AdminMenu GetModelById(long Id)
        {
            AdminMenu model = new AdminMenu()
            {
                ID = Id
            };

            if (EntityQuery <AdminMenu> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #11
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="CustomAccReceiptEntryerID"></param>
        /// <returns></returns>
        public CustomAccReceiptEntryModel GetModelById(int accountId)
        {
            CustomAccReceiptEntryModel model = new CustomAccReceiptEntryModel()
            {
                ID = accountId
            };

            if (EntityQuery <CustomAccReceiptEntryModel> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #12
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="TicketerID"></param>
        /// <returns></returns>
        public CustomChargeCardsModel GetModelById(int accountId)
        {
            CustomChargeCardsModel model = new CustomChargeCardsModel()
            {
                ID = accountId
            };

            if (EntityQuery <CustomChargeCardsModel> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #13
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="TicketerID"></param>
        /// <returns></returns>
        public ContractModel GetModelById(long id)
        {
            ContractModel model = new ContractModel()
            {
                ID = id
            };

            if (EntityQuery <ContractModel> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #14
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="MerchanterID"></param>
        /// <returns></returns>
        public MerchantModel GetModelById(int Id)
        {
            MerchantModel model = new MerchantModel()
            {
                TenantId = TenantId, ID = Id
            };

            if (EntityQuery <MerchantModel> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="TicketerID"></param>
        /// <returns></returns>
        public CustomFinancialModel GetModelById(int customFinancialId)
        {
            CustomFinancialModel model = new CustomFinancialModel()
            {
                ID = customFinancialId
            };

            if (EntityQuery <CustomFinancialModel> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="customerID"></param>
        /// <returns></returns>
        public CinemaChainModel GetModelById(int accountId)
        {
            CinemaChainModel model = new CinemaChainModel()
            {
                ID = accountId
            };

            if (EntityQuery <CinemaChainModel> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #17
0
        /// <summary>
        /// 获取一个顾客信息,如果没有则返回空对象
        /// </summary>
        /// <param name="customerID"></param>
        /// <returns></returns>
        public CustomerContactInfo GetCustomerContactInfo(string customerID)
        {
            CustomerContactInfo info = new CustomerContactInfo()
            {
                CustomerID = customerID
            };

            if (EntityQuery <CustomerContactInfo> .Fill(info))
            {
                return(info);
            }
            else
            {
                return(null);
            }
        }
Beispiel #18
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="customerID"></param>
        /// <returns></returns>
        public TenantModel GetModelById(int accountId)
        {
            TenantModel model = new TenantModel()
            {
                ID = accountId
            };

            if (EntityQuery <TenantModel> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #19
0
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="customerID"></param>
        /// <returns></returns>
        public AdminRole GetModelById(int Id)
        {
            AdminRole model = new AdminRole()
            {
                ID = Id
            };

            if (EntityQuery <AdminRole> .Fill(model))
            {
                return(model);
            }
            else
            {
                return(null);
            }
        }
        /// <summary>
        /// 查 根据Id获取详情,如果没有则返回空对象
        /// </summary>
        /// <param name="TicketerID"></param>
        /// <returns></returns>
        public ContractViewModel GetViewModelById(long contractId)
        {
            ContractModel contract = GetModelById(contractId);

            if (contract != null)
            {
                CustomModel customModel = new CustomModel()
                {
                    ID = contract.CustomId
                };
                if (EntityQuery <CustomModel> .Fill(customModel))
                {
                    return(new ContractViewModel()
                    {
                        ID = contract.ID,
                        CustomId = contract.CustomId,
                        CustomName = customModel.CustomName,
                        ContractNo = contract.ContractNo,
                        ContractAmount = contract.ContractAmount,
                        Deductions = contract.Deductions,
                        Balance = contract.Balance,
                        Remark = contract.Remark,
                        Sort = contract.Sort,
                        Status = contract.Status,
                        CreateId = contract.CreateId,
                        CreateUser = contract.CreateUser,
                        CreateIP = contract.CreateIP,
                        CreateTime = contract.CreateTime,
                    });
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }