Example #1
0
        private object cus(web_db._Weighing.TblContractType typecontract, Models.tbls.portage.portage model)
        {
            if (typecontract.KindCotractType == web_db._Weighing.TblContractType.KindCotractTypeEnum.ABaskul)
            {
                var conf = typecontract.ConfigABaskul();
                var c    =
                    db.TblCustomers.Include(a => a.TblContracts).Where(a =>
                                                                       a.FkSalmali == User._getuserSalMaliDef() &&
                                                                       a.IsEnable
                                                                       ).OrderBy(a => a.Code).Select(a => new web_sard.Models.tbls.customer.customer(a, db, web_db._Weighing.TblContractType.KindCotractTypeEnum.ASabad, true)).ToList();

                if (model.FkCustomer.IsEmpty() && conf.CustomerPishfarz.HasValue)
                {
                    var cc = (c.SingleOrDefault(a => a.Code == conf.CustomerPishfarz) ?? new web_sard.Models.tbls.customer.customer());
                    model.FkCustomer  = cc.Id;
                    model.Customer    = cc;
                    model.Customerstr = cc.Title;
                }
                return(c);
            }
            else
            {
                return
                    (db.TblCustomers.Include(a => a.TblContracts).Where(a =>
                                                                        a.FkSalmali == User._getuserSalMaliDef() &&
                                                                        a.IsEnable &&
                                                                        a.TblContracts.Any(s => s.FkContractType == typecontract.Id)
                                                                        ).OrderBy(a => a.Code).Select(a => new web_sard.Models.tbls.customer.customer(a, db, web_db._Weighing.TblContractType.KindCotractTypeEnum.ASabad, true)).ToList());
            }
        }
Example #2
0
 private object cus(web_db._Weighing.TblContractType typecontract, Models.tbls.portage.portage model)
 {
     return
         (db.TblCustomers.Include(a => a.TblContracts).Where(a =>
                                                             a.FkSalmali == User._getuserSalMaliDef() &&
                                                             a.IsEnable &&
                                                             a.TblContracts.Any(s => s.FkContractType == typecontract.Id)
                                                             ).OrderBy(a => a.Code).Select(a => new web_sard.Models.tbls.customer.customer(a, db, web_db._Weighing.TblContractType.KindCotractTypeEnum.ASardKhane, true)).ToList());
 }
Example #3
0
        public ContractType(web_db._Weighing.TblContractType r)
        {
            this.Code  = r.Code;
            this.Title = r.Title;
            this.Id    = r.Id;
            //this.IsEntry = r.IsEntry;
            //this.IsExit = r.IsExit;
            //this.IsProduct1Packing0 = r.IsProduct1Packing0;
            //this.Needbascule = r.Needbascule;

            //this.OutControlByContract = r.OutControlByContract;
            //this.OutControlByLocation = r.OutControlByLocation;
            //this.OutControlByPercent = r.OutControlByPercent;
        }