コード例 #1
0
        public int PrevId(int id)
        {
            int temp = 0;

            if (id != 0)
            {
                temp = (from b in _JobworkerRepository.Instance
                        join p in _unitOfWork.Repository <Person>().Instance on b.PersonID equals p.PersonID into PersonTable
                        from PersonTab in PersonTable.DefaultIfEmpty()
                        orderby PersonTab.Name
                        select b.PersonID).AsEnumerable().TakeWhile(p => p != id).LastOrDefault();
            }
            else
            {
                temp = (from b in _JobworkerRepository.Instance
                        join p in _unitOfWork.Repository <Person>().Instance on b.PersonID equals p.PersonID into PersonTable
                        from PersonTab in PersonTable.DefaultIfEmpty()
                        orderby PersonTab.Name
                        select b.PersonID).AsEnumerable().LastOrDefault();
            }
            if (temp != 0)
            {
                return(temp);
            }
            else
            {
                return(id);
            }
        }
コード例 #2
0
        public IEnumerable <ComboBoxList> GetJobWorkerHelpList(int Processid, string term)
        {
            int CurrentSiteId     = (int)System.Web.HttpContext.Current.Session["SiteId"];
            int CurrentDivisionId = (int)System.Web.HttpContext.Current.Session["DivisionId"];


            string DivId  = "|" + CurrentDivisionId.ToString() + "|";
            string SiteId = "|" + CurrentSiteId.ToString() + "|";


            var list = (from b in _unitOfWork.Repository <JobWorker>().Instance
                        join bus in _unitOfWork.Repository <BusinessEntity>().Instance on b.PersonID equals bus.PersonID into BusinessEntityTable
                        from BusinessEntityTab in BusinessEntityTable.DefaultIfEmpty()
                        join p in _unitOfWork.Repository <Person>().Instance on b.PersonID equals p.PersonID into PersonTable
                        from PersonTab in PersonTable.DefaultIfEmpty()
                        join pp in _unitOfWork.Repository <PersonProcess>().Instance on b.PersonID equals pp.PersonId into PersonProcessTable
                        from PersonProcessTab in PersonProcessTable.DefaultIfEmpty()
                        where PersonProcessTab.ProcessId == Processid &&
                        (string.IsNullOrEmpty(term) ? 1 == 1 : PersonTab.Name.ToLower().Contains(term.ToLower())) &&
                        BusinessEntityTab.DivisionIds.IndexOf(DivId) != -1 &&
                        BusinessEntityTab.SiteIds.IndexOf(SiteId) != -1
                        orderby PersonTab.Name
                        select new ComboBoxList
            {
                Id = b.PersonID,
                PropFirst = PersonTab.Name
                            //PropSecond  = BusinessEntityTab.SiteIds.IndexOf(SiteId).ToString()
            }
                        ).Take(20);

            return(list.ToList());
        }
コード例 #3
0
        public int NextId(int id)
        {
            int temp = 0;

            if (id != 0)
            {
                temp = (from b in db.Courier
                        join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
                        from PersonTab in PersonTable.DefaultIfEmpty()
                        orderby PersonTab.Name
                        select b.PersonID).AsEnumerable().SkipWhile(p => p != id).Skip(1).FirstOrDefault();
            }
            else
            {
                temp = (from b in db.Courier
                        join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
                        from PersonTab in PersonTable.DefaultIfEmpty()
                        orderby PersonTab.Name
                        select b.PersonID).FirstOrDefault();
            }
            if (temp != 0)
            {
                return(temp);
            }
            else
            {
                return(id);
            }
        }
コード例 #4
0
        public int PrevId(int id)
        {
            int temp = 0;

            if (id != 0)
            {
                temp = (from b in db.Supplier
                        join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
                        from PersonTab in PersonTable.DefaultIfEmpty()
                        orderby PersonTab.Name
                        select b.PersonID).AsEnumerable().TakeWhile(p => p != id).LastOrDefault();
            }
            else
            {
                temp = (from b in db.Supplier
                        join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
                        from PersonTab in PersonTable.DefaultIfEmpty()
                        orderby PersonTab.Name
                        select b.PersonID).AsEnumerable().LastOrDefault();
            }
            if (temp != 0)
            {
                return(temp);
            }
            else
            {
                return(id);
            }
        }
コード例 #5
0
        public IQueryable <JobWorkerIndexViewModel> GetJobWorkerListForIndex()
        {
            var TempPan = from Pr in db.PersonRegistration
                          where Pr.RegistrationType == PersonRegistrationType.PANNo
                          select new
            {
                PersonId = Pr.PersonId,
                PanNo    = Pr.RegistrationNo
            };

            var temp = from p in db.JobWorker
                       join p1 in db.Persons on p.PersonID equals p1.PersonID into PersonTable
                       from PersonTab in PersonTable.DefaultIfEmpty()
                       join Pan in TempPan on p.PersonID equals Pan.PersonId into PersonPanTable
                       from PersonPanTab in PersonPanTable.DefaultIfEmpty()
                       orderby PersonTab.Name
                       select new JobWorkerIndexViewModel
            {
                PersonId = PersonTab.PersonID,
                Name     = PersonTab.Name,
                Code     = PersonTab.Code,
                Mobile   = PersonTab.Mobile,
                PanNo    = PersonPanTab.PanNo
            };

            return(temp);
        }
コード例 #6
0
        public ProductUidDetail FGetProductUidDetail(string ProductUidNo)
        {
            ProductUidDetail UidDetail = (from Pu in _productRepository.Instance
                                          join P in _unitOfWork.Repository <Product>().Instance on Pu.ProductId equals P.ProductId into ProductTable
                                          from Producttab in ProductTable.DefaultIfEmpty()
                                          join Pr in _unitOfWork.Repository <Process>().Instance on Pu.CurrenctProcessId equals Pr.ProcessId into ProcessTable
                                          from ProcessTab in ProcessTable.DefaultIfEmpty()
                                          join Pe in _unitOfWork.Repository <Person>().Instance on Pu.LastTransactionPersonId equals Pe.PersonID into PersonTable
                                          from PersonTab in PersonTable.DefaultIfEmpty()
                                          where Pu.ProductUidName == ProductUidNo
                                          select new ProductUidDetail
            {
                ProductUidId = Pu.ProductUIDId,
                ProductId = Pu.ProductId,
                ProductName = Producttab.ProductName,
                PrevProcessId = Pu.CurrenctProcessId,
                PrevProcessName = ProcessTab.ProcessName,
                LastTransactionDocNo = Pu.LastTransactionDocNo,
                LastTransactionDocDate = Pu.LastTransactionDocDate,
                LastTransactionPersonName = PersonTab.Name,
                CurrenctGodownId = Pu.CurrenctGodownId,
                Status = Pu.Status,
                GenDocTypeId = Pu.GenDocTypeId,
                DivisionId = Producttab.DivisionId
            }).FirstOrDefault();

            return(UidDetail);
        }
コード例 #7
0
ファイル: BuyerService.cs プロジェクト: radtek/HomeFurnishing
 public Buyer GetBuyerByName(string buyer)
 {
     return((from b in db.Buyer
             join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
             from PersonTab in PersonTable.DefaultIfEmpty()
             where PersonTab.Name == buyer
             select b).FirstOrDefault());
 }
コード例 #8
0
 public Employee GetEmployeeByName(string Employee)
 {
     return((from b in db.Employee
             join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
             from PersonTab in PersonTable.DefaultIfEmpty()
             where PersonTab.Name == Employee
             select b
             ).FirstOrDefault());
 }
コード例 #9
0
 public JobWorker GetJobWorkerByName(string JobWorker)
 {
     return((from b in _JobworkerRepository.Instance
             join p in _unitOfWork.Repository <Person>().Instance on b.PersonID equals p.PersonID into PersonTable
             from PersonTab in PersonTable.DefaultIfEmpty()
             where PersonTab.Name == JobWorker
             select b
             ).FirstOrDefault());
 }
コード例 #10
0
 public Manufacturer GetManufacturerByName(string Manufacturer)
 {
     return((from b in db.Manufacturer
             join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
             from PersonTab in PersonTable.DefaultIfEmpty()
             where PersonTab.Name == Manufacturer
             select new Manufacturer
     {
         PersonID = b.PersonID,
     }).FirstOrDefault());
 }
コード例 #11
0
 public Agent GetAgentByName(string Agent)
 {
     return((from b in db.Agent
             join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
             from PersonTab in PersonTable.DefaultIfEmpty()
             where PersonTab.Name == Agent
             select new Agent
     {
         PersonID = b.PersonID,
     }).FirstOrDefault());
 }
コード例 #12
0
 public SupplierViewModel GetSupplierByName(string Supplier)
 {
     return((from b in db.Supplier
             join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
             from PersonTab in PersonTable.DefaultIfEmpty()
             where PersonTab.Name == Supplier
             select new SupplierViewModel
     {
         PersonId = b.PersonID,
         SalesTaxGroupPartyId = b.SalesTaxGroupPartyId
     }).FirstOrDefault());
 }
コード例 #13
0
        public IQueryable <SupplierIndexViewModel> GetSupplierListForIndex()
        {
            var temp = from b in db.Supplier
                       join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
                       from PersonTab in PersonTable.DefaultIfEmpty()
                       orderby PersonTab.Name
                       select new SupplierIndexViewModel
            {
                PersonId = PersonTab.PersonID,
                Name     = PersonTab.Name
            };

            return(temp);
        }
コード例 #14
0
        public IQueryable <TransporterIndexViewModel> GetTransporterListForIndex()
        {
            var temp = from p in db.Transporter
                       join p1 in db.Persons on p.PersonID equals p1.PersonID into PersonTable
                       from PersonTab in PersonTable.DefaultIfEmpty()
                       orderby PersonTab.Name
                       select new TransporterIndexViewModel
            {
                PersonId = PersonTab.PersonID,
                Name     = PersonTab.Name
            };

            return(temp);
        }
コード例 #15
0
        public AgentViewModel GetAgentViewModel(int id)
        {
            AgentViewModel Agentviewmodel = (from b in db.Agent
                                             join bus in db.BusinessEntity on b.PersonID equals bus.PersonID into BusinessEntityTable
                                             from BusinessEntityTab in BusinessEntityTable.DefaultIfEmpty()
                                             join p in db.Persons on BusinessEntityTab.PersonID equals p.PersonID into PersonTable
                                             from PersonTab in PersonTable.DefaultIfEmpty()
                                             join pa in db.PersonAddress on PersonTab.PersonID equals pa.PersonId into PersonAddressTable
                                             from PersonAddressTab in PersonAddressTable.DefaultIfEmpty()
                                             join ac in db.LedgerAccount on PersonTab.PersonID equals ac.PersonId into AccountTable
                                             from AccountTab in AccountTable.DefaultIfEmpty()
                                             where PersonTab.PersonID == id
                                             select new AgentViewModel
            {
                PersonId = PersonTab.PersonID,
                Name = PersonTab.Name,
                Suffix = PersonTab.Suffix,
                Code = PersonTab.Code,
                Phone = PersonTab.Phone,
                Mobile = PersonTab.Mobile,
                Email = PersonTab.Email,
                Address = PersonAddressTab.Address,
                CityId = PersonAddressTab.CityId,
                Zipcode = PersonAddressTab.Zipcode,
                IsSisterConcern = BusinessEntityTab.IsSisterConcern,
                IsActive = PersonTab.IsActive,
                LedgerAccountGroupId = AccountTab.LedgerAccountGroupId,
                CreatedBy = PersonTab.CreatedBy,
                CreatedDate = PersonTab.CreatedDate,
                PersonAddressID = PersonAddressTab.PersonAddressID,
                AccountId = AccountTab.LedgerAccountId,
                ImageFileName = PersonTab.ImageFileName,
                ImageFolderName = PersonTab.ImageFolderName
            }).FirstOrDefault();

            var PersonRegistration = (from pp in db.PersonRegistration
                                      where pp.PersonId == id
                                      select new
            {
                PersonRegistrationId = pp.PersonRegistrationID,
                RregistrationType = pp.RegistrationType,
                RregistrationNo = pp.RegistrationNo
            }).ToList();


            return(Agentviewmodel);
        }
コード例 #16
0
        public IQueryable <PersonContactViewModel> GetPersonContactListForIndex(int PersonId)
        {
            var temp = from pc in db.PersonContacts
                       join p in db.Persons on pc.ContactId equals p.PersonID into PersonTable
                       from PersonTab in PersonTable.DefaultIfEmpty()
                       orderby pc.PersonContactID
                       where pc.PersonId == PersonId
                       select new PersonContactViewModel
            {
                PersonContactId = pc.PersonContactID,
                Name            = PersonTab.Name,
                Phone           = PersonTab.Phone,
                Mobile          = PersonTab.Mobile,
                Email           = PersonTab.Email
            };

            return(temp);
        }
コード例 #17
0
        public IQueryable <EmployeeIndexViewModel> GetEmployeeListForIndex()
        {
            var temp = from p in db.Employee
                       join p1 in db.Persons on p.PersonID equals p1.PersonID into PersonTable
                       from PersonTab in PersonTable.DefaultIfEmpty()
                       orderby PersonTab.Name
                       select new EmployeeIndexViewModel
            {
                PersonId = PersonTab.PersonID,
                Name     = PersonTab.Name,
                Code     = PersonTab.Code,
                Mobile   = PersonTab.Mobile,
                Phone    = PersonTab.Phone,
                Suffix   = PersonTab.Suffix,
            };

            return(temp);
        }
コード例 #18
0
        public ComboBoxPagedResult GetListWithProcess(string searchTerm, int pageSize, int pageNum, int ProcessId)
        {
            int CurrentSiteId     = (int)System.Web.HttpContext.Current.Session["SiteId"];
            int CurrentDivisionId = (int)System.Web.HttpContext.Current.Session["DivisionId"];

            string DivId  = "|" + CurrentDivisionId.ToString() + "|";
            string SiteId = "|" + CurrentSiteId.ToString() + "|";

            var list = (from b in _JobworkerRepository.Instance
                        join bus in _unitOfWork.Repository <BusinessEntity>().Instance on b.PersonID equals bus.PersonID into BusinessEntityTable
                        from BusinessEntityTab in BusinessEntityTable.DefaultIfEmpty()
                        join p in _unitOfWork.Repository <Person>().Instance on b.PersonID equals p.PersonID into PersonTable
                        from PersonTab in PersonTable.DefaultIfEmpty()
                        join pp in _unitOfWork.Repository <PersonProcess>().Instance on b.PersonID equals pp.PersonId into PersonProcessTable
                        from PersonProcessTab in PersonProcessTable.DefaultIfEmpty()
                        where PersonProcessTab.ProcessId == ProcessId &&
                        (string.IsNullOrEmpty(searchTerm) ? 1 == 1 : (PersonTab.Name.ToLower().Contains(searchTerm.ToLower()) || PersonTab.Code.ToLower().Contains(searchTerm.ToLower()))) &&
                        BusinessEntityTab.DivisionIds.IndexOf(DivId) != -1 &&
                        (PersonTab.IsActive == null ? 1 == 1 : PersonTab.IsActive == true) &&
                        BusinessEntityTab.SiteIds.IndexOf(SiteId) != -1
                        orderby PersonTab.Name
                        select new ComboBoxResult
            {
                id = b.PersonID.ToString(),
                text = PersonTab.Name + "|" + PersonTab.Code,
            }
                        );

            var temp = list
                       .Skip(pageSize * (pageNum - 1)).Take(pageSize).ToList();

            var count = list.Count();

            ComboBoxPagedResult Data = new ComboBoxPagedResult();

            Data.Results = temp;
            Data.Total   = count;

            return(Data);
        }
コード例 #19
0
ファイル: BuyerService.cs プロジェクト: radtek/HomeFurnishing
        public IQueryable <BuyerIndexViewModel> GetBuyerListForIndex()
        {
            var temp = from b in db.Buyer
                       join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
                       from PersonTab in PersonTable.DefaultIfEmpty()
                       join add in db.PersonAddress on PersonTab.PersonID equals add.PersonId
                       into table2
                       from addres in table2.DefaultIfEmpty()
                       orderby PersonTab.Name
                       select new BuyerIndexViewModel
            {
                PersonId = PersonTab.PersonID,
                Name     = PersonTab.Name,
                Code     = PersonTab.Code,
                Suffix   = PersonTab.Suffix,
                Mobile   = PersonTab.Mobile,
                Address  = addres.Address,
                City     = addres.City.CityName,
            };

            return(temp);
        }
コード例 #20
0
        public ManufacturerViewModel GetManufacturerViewModel(int id)
        {
            ManufacturerViewModel Manufacturerviewmodel = (from b in db.Manufacturer
                                                           join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
                                                           from PersonTab in PersonTable.DefaultIfEmpty()
                                                           where PersonTab.PersonID == id
                                                           select new ManufacturerViewModel
            {
                PersonId = PersonTab.PersonID,
                Name = PersonTab.Name,
                Suffix = PersonTab.Suffix,
                Code = PersonTab.Code,
                Description = PersonTab.Description,
                IsActive = PersonTab.IsActive,
                CreatedBy = PersonTab.CreatedBy,
                CreatedDate = PersonTab.CreatedDate,
                ImageFileName = PersonTab.ImageFileName,
                ImageFolderName = PersonTab.ImageFolderName
            }).FirstOrDefault();

            return(Manufacturerviewmodel);
        }
コード例 #21
0
 public BusinessEntity GetBusinessEntityByName(string BusinessEntity)
 {
     return((from b in db.BusinessEntity
             join p in db.Persons on b.PersonID equals p.PersonID into PersonTable from PersonTab in PersonTable.DefaultIfEmpty()
             where PersonTab.Name == BusinessEntity
             select b
             ).FirstOrDefault());
 }
コード例 #22
0
        public SupplierViewModel GetSupplierViewModel(int id)
        {
            SupplierViewModel Supplierviewmodel = (from b in db.Supplier
                                                   join bus in db.BusinessEntity on b.PersonID equals bus.PersonID into BusinessEntityTable
                                                   from BusinessEntityTab in BusinessEntityTable.DefaultIfEmpty()
                                                   join p in db.Persons on BusinessEntityTab.PersonID equals p.PersonID into PersonTable
                                                   from PersonTab in PersonTable.DefaultIfEmpty()
                                                   join pa in db.PersonAddress on PersonTab.PersonID equals pa.PersonId into PersonAddressTable
                                                   from PersonAddressTab in PersonAddressTable.DefaultIfEmpty()
                                                   join ac in db.LedgerAccount on PersonTab.PersonID equals ac.PersonId into AccountTable
                                                   from AccountTab in AccountTable.DefaultIfEmpty()
                                                   where PersonTab.PersonID == id
                                                   select new SupplierViewModel
            {
                PersonId = PersonTab.PersonID,
                Name = PersonTab.Name,
                Suffix = PersonTab.Suffix,
                Code = PersonTab.Code,
                Phone = PersonTab.Phone,
                Mobile = PersonTab.Mobile,
                Email = PersonTab.Email,
                Address = PersonAddressTab.Address,
                CityId = PersonAddressTab.CityId,
                Zipcode = PersonAddressTab.Zipcode,
                IsSisterConcern = BusinessEntityTab.IsSisterConcern,
                PersonRateGroupId = BusinessEntityTab.PersonRateGroupId,
                CreaditDays = BusinessEntityTab.CreaditDays,
                CreaditLimit = BusinessEntityTab.CreaditLimit,
                IsActive = PersonTab.IsActive,
                SalesTaxGroupPartyId = b.SalesTaxGroupPartyId,
                LedgerAccountGroupId = AccountTab.LedgerAccountGroupId,
                CreatedBy = PersonTab.CreatedBy,
                CreatedDate = PersonTab.CreatedDate,
                PersonAddressID = PersonAddressTab.PersonAddressID,
                AccountId = AccountTab.LedgerAccountId,
                SiteIds = BusinessEntityTab.SiteIds,
                DivisionIds = BusinessEntityTab.DivisionIds,
                Tags = PersonTab.Tags,
                ImageFileName = PersonTab.ImageFileName,
                ImageFolderName = PersonTab.ImageFolderName
            }).FirstOrDefault();

            var PersonProcess = (from pp in db.PersonProcess
                                 where pp.PersonId == id
                                 select new
            {
                ProcessId = pp.ProcessId
            }).ToList();

            foreach (var item in PersonProcess)
            {
                if (Supplierviewmodel.ProcessIds == "" || Supplierviewmodel.ProcessIds == null)
                {
                    Supplierviewmodel.ProcessIds = item.ProcessId.ToString();
                }
                else
                {
                    Supplierviewmodel.ProcessIds = Supplierviewmodel.ProcessIds + "," + item.ProcessId.ToString();
                }
            }


            var PersonRegistration = (from pp in db.PersonRegistration
                                      where pp.PersonId == id
                                      select new
            {
                PersonRegistrationId = pp.PersonRegistrationID,
                RregistrationType = pp.RegistrationType,
                RregistrationNo = pp.RegistrationNo
            }).ToList();

            if (PersonRegistration != null)
            {
                foreach (var item in PersonRegistration)
                {
                    if (item.RregistrationType == PersonRegistrationType.CstNo)
                    {
                        Supplierviewmodel.PersonRegistrationCstNoID = item.PersonRegistrationId;
                        Supplierviewmodel.CstNo = item.RregistrationNo;
                    }

                    if (item.RregistrationType == PersonRegistrationType.TinNo)
                    {
                        Supplierviewmodel.PersonRegistrationTinNoID = item.PersonRegistrationId;
                        Supplierviewmodel.TinNo = item.RregistrationNo;
                    }
                }
            }

            string Divisions = Supplierviewmodel.DivisionIds;

            if (Divisions != null)
            {
                Divisions = Divisions.Replace('|', ' ');
                Supplierviewmodel.DivisionIds = Divisions;
            }

            string Sites = Supplierviewmodel.SiteIds;

            if (Sites != null)
            {
                Sites = Sites.Replace('|', ' ');
                Supplierviewmodel.SiteIds = Sites;
            }

            return(Supplierviewmodel);
        }
コード例 #23
0
        public CourierViewModel GetCourierViewModel(int id)
        {
            CourierViewModel Courierviewmodel = (from b in db.Courier
                                                 join bus in db.BusinessEntity on b.PersonID equals bus.PersonID into BusinessEntityTable
                                                 from BusinessEntityTab in BusinessEntityTable.DefaultIfEmpty()
                                                 join p in db.Persons on BusinessEntityTab.PersonID equals p.PersonID into PersonTable
                                                 from PersonTab in PersonTable.DefaultIfEmpty()
                                                 join pa in db.PersonAddress on b.PersonID equals pa.PersonId into PersonAddressTable
                                                 from PersonAddressTab in PersonAddressTable.DefaultIfEmpty()
                                                 join ac in db.LedgerAccount on b.PersonID equals ac.PersonId into AccountTable
                                                 from AccountTab in AccountTable.DefaultIfEmpty()
                                                 where b.PersonID == id
                                                 select new CourierViewModel
            {
                PersonId = b.PersonID,
                Name = PersonTab.Name,
                Suffix = PersonTab.Suffix,
                Code = PersonTab.Code,
                Phone = PersonTab.Phone,
                Mobile = PersonTab.Mobile,
                Email = PersonTab.Email,
                Address = PersonAddressTab.Address,
                CityId = PersonAddressTab.CityId,
                Zipcode = PersonAddressTab.Zipcode,
                TdsCategoryId = BusinessEntityTab.TdsCategoryId,
                TdsGroupId = BusinessEntityTab.TdsGroupId,
                IsActive = PersonTab.IsActive,
                LedgerAccountGroupId = AccountTab.LedgerAccountGroupId,
                CreatedBy = PersonTab.CreatedBy,
                CreatedDate = PersonTab.CreatedDate,
                PersonAddressID = PersonAddressTab.PersonAddressID,
                AccountId = AccountTab.LedgerAccountId,
                ImageFileName = PersonTab.ImageFileName,
                ImageFolderName = PersonTab.ImageFolderName
            }
                                                 ).FirstOrDefault();

            var PersonRegistration = (from pp in db.PersonRegistration
                                      where pp.PersonId == id
                                      select new
            {
                PersonRegistrationId = pp.PersonRegistrationID,
                RregistrationType = pp.RegistrationType,
                RregistrationNo = pp.RegistrationNo
            }).ToList();

            if (PersonRegistration != null)
            {
                foreach (var item in PersonRegistration)
                {
                    if (item.RregistrationType == PersonRegistrationType.PANNo)
                    {
                        Courierviewmodel.PersonRegistrationPanNoID = item.PersonRegistrationId;
                        Courierviewmodel.PanNo = item.RregistrationNo;
                    }

                    if (item.RregistrationType == PersonRegistrationType.ServiceTaxNo)
                    {
                        Courierviewmodel.PersonRegistrationServiceTaxNoID = item.PersonRegistrationId;
                        Courierviewmodel.ServiceTaxNo = item.RregistrationNo;
                    }

                    if (item.RregistrationType == PersonRegistrationType.KYCNo)
                    {
                        Courierviewmodel.PersonRegistrationKYCNoID = item.PersonRegistrationId;
                        Courierviewmodel.KYCNo = item.RregistrationNo;
                    }
                }
            }

            return(Courierviewmodel);
        }
コード例 #24
0
ファイル: BuyerService.cs プロジェクト: radtek/HomeFurnishing
        public BuyerViewModel GetBuyerViewModel(int id)
        {
            BuyerViewModel buyerviewmodel = (from b in db.Buyer
                                             join bus in db.BusinessEntity on b.PersonID equals bus.PersonID into BusinessEntityTable
                                             from BusinessEntityTab in BusinessEntityTable.DefaultIfEmpty()
                                             join p in db.Persons on b.PersonID equals p.PersonID into PersonTable
                                             from PersonTab in PersonTable.DefaultIfEmpty()
                                             join pa in db.PersonAddress on PersonTab.PersonID equals pa.PersonId into PersonAddressTable
                                             from PersonAddressTab in PersonAddressTable.DefaultIfEmpty()
                                             join ac in db.LedgerAccount on PersonTab.PersonID equals ac.PersonId into AccountTable
                                             from AccountTab in AccountTable.DefaultIfEmpty()
                                             where PersonTab.PersonID == id
                                             select new BuyerViewModel
            {
                PersonId = PersonTab.PersonID,
                Name = PersonTab.Name,
                Suffix = PersonTab.Suffix,
                Code = PersonTab.Code,
                Phone = PersonTab.Phone,
                Mobile = PersonTab.Mobile,
                Email = PersonTab.Email,
                Address = PersonAddressTab.Address,
                CityId = PersonAddressTab.CityId,
                Zipcode = PersonAddressTab.Zipcode,
                PersonRateGroupId = BusinessEntityTab.PersonRateGroupId,
                CreaditDays = BusinessEntityTab.CreaditDays,
                CreaditLimit = BusinessEntityTab.CreaditLimit,
                IsActive = PersonTab.IsActive,
                SalesTaxGroupPartyId = BusinessEntityTab.SalesTaxGroupPartyId,
                CreatedBy = PersonTab.CreatedBy,
                CreatedDate = PersonTab.CreatedDate,
                SiteIds = BusinessEntityTab.SiteIds,
                Tags = PersonTab.Tags,
                ImageFileName = PersonTab.ImageFileName,
                ImageFolderName = PersonTab.ImageFolderName,
                ParentId = BusinessEntityTab.ParentId,
                GuarantorId = BusinessEntityTab.GuarantorId,
                IsSisterConcern = (bool?)BusinessEntityTab.IsSisterConcern ?? false,
                AccountId = (int?)AccountTab.LedgerAccountId ?? 0,
                PersonAddressID = (PersonAddressTab == null ? 0 : PersonAddressTab.PersonAddressID),
                LedgerAccountGroupId = (int?)AccountTab.LedgerAccountGroupId ?? 0,
            }).FirstOrDefault();

            var PersonRegistration = (from pp in db.PersonRegistration
                                      where pp.PersonId == id
                                      select new
            {
                PersonRegistrationId = pp.PersonRegistrationID,
                RregistrationType = pp.RegistrationType,
                RregistrationNo = pp.RegistrationNo
            }).ToList();

            if (PersonRegistration != null)
            {
                foreach (var item in PersonRegistration)
                {
                    if (item.RregistrationType == PersonRegistrationType.CstNo)
                    {
                        buyerviewmodel.PersonRegistrationCstNoID = item.PersonRegistrationId;
                        buyerviewmodel.CstNo = item.RregistrationNo;
                    }

                    if (item.RregistrationType == PersonRegistrationType.TinNo)
                    {
                        buyerviewmodel.PersonRegistrationTinNoID = item.PersonRegistrationId;
                        buyerviewmodel.TinNo = item.RregistrationNo;
                    }
                }
            }

            string Sites = buyerviewmodel.SiteIds;

            if (Sites != null)
            {
                Sites = Sites.Replace('|', ' ');
                buyerviewmodel.SiteIds = Sites;
            }

            return(buyerviewmodel);
        }
コード例 #25
0
        public PersonViewModel GetPersonViewModel(int id)
        {
            PersonViewModel PersonViewModel = (from bus in db.BusinessEntity
                                               join p in db.Persons on bus.PersonID equals p.PersonID into PersonTable
                                               from PersonTab in PersonTable.DefaultIfEmpty()
                                               join pa in db.PersonAddress on PersonTab.PersonID equals pa.PersonId into PersonAddressTable
                                               from PersonAddressTab in PersonAddressTable.DefaultIfEmpty()
                                               join ac in db.LedgerAccount on PersonTab.PersonID equals ac.PersonId into AccountTable
                                               from AccountTab in AccountTable.DefaultIfEmpty()
                                               where PersonTab.PersonID == id
                                               select new PersonViewModel
            {
                PersonID = PersonTab.PersonID,
                Name = PersonTab.Name,
                Suffix = PersonTab.Suffix,
                Code = PersonTab.Code,
                Phone = PersonTab.Phone,
                Mobile = PersonTab.Mobile,
                Email = PersonTab.Email,
                Address = PersonAddressTab.Address,
                CityId = PersonAddressTab.CityId,
                CityName = PersonAddressTab.City.CityName,
                Zipcode = PersonAddressTab.Zipcode,
                PersonRateGroupId = bus.PersonRateGroupId,
                CreaditDays = bus.CreaditDays,
                CreaditLimit = bus.CreaditLimit,
                IsActive = PersonTab.IsActive,
                SalesTaxGroupPartyId = bus.SalesTaxGroupPartyId,
                CreatedBy = PersonTab.CreatedBy,
                CreatedDate = PersonTab.CreatedDate,
                SiteIds = bus.SiteIds,
                Tags = PersonTab.Tags,
                ImageFileName = PersonTab.ImageFileName,
                ImageFolderName = PersonTab.ImageFolderName,
                IsSisterConcern = (bool?)bus.IsSisterConcern ?? false,
                AccountId = (int?)AccountTab.LedgerAccountId ?? 0,
                PersonAddressID = (PersonAddressTab == null ? 0 : PersonAddressTab.PersonAddressID),
                LedgerAccountGroupId = (int?)AccountTab.LedgerAccountGroupId ?? 0,
            }).FirstOrDefault();

            var PersonRegistration = (from pp in db.PersonRegistration
                                      where pp.PersonId == id
                                      select new
            {
                PersonRegistrationId = pp.PersonRegistrationID,
                RregistrationType = pp.RegistrationType,
                RregistrationNo = pp.RegistrationNo
            }).ToList();

            if (PersonRegistration != null)
            {
                foreach (var item in PersonRegistration)
                {
                    if (item.RregistrationType == PersonRegistrationType.CstNo)
                    {
                        PersonViewModel.PersonRegistrationCstNoID = item.PersonRegistrationId;
                        PersonViewModel.CstNo = item.RregistrationNo;
                    }

                    if (item.RregistrationType == PersonRegistrationType.TinNo)
                    {
                        PersonViewModel.PersonRegistrationTinNoID = item.PersonRegistrationId;
                        PersonViewModel.TinNo = item.RregistrationNo;
                    }

                    if (item.RregistrationType == PersonRegistrationType.PANNo)
                    {
                        PersonViewModel.PersonRegistrationPanNoID = item.PersonRegistrationId;
                        PersonViewModel.PanNo = item.RregistrationNo;
                    }

                    if (item.RregistrationType == PersonRegistrationType.GstNo)
                    {
                        PersonViewModel.PersonRegistrationGstNoID = item.PersonRegistrationId;
                        PersonViewModel.GstNo = item.RregistrationNo;
                    }

                    if (item.RregistrationType == PersonRegistrationType.AadharNo)
                    {
                        PersonViewModel.PersonRegistrationAadharNoID = item.PersonRegistrationId;
                        PersonViewModel.AadharNo = item.RregistrationNo;
                    }
                }
            }

            return(PersonViewModel);
        }
コード例 #26
0
        public IQueryable <DispatchWaybillHeaderViewModel> GetDispatchWaybillHeaderList(int DocTypeId, string Uname)
        {
            IQueryable <DispatchWaybillHeaderViewModel> DispatchWaybillHeader = from H in db.DispatchWaybillHeader
                                                                                join p in db.Persons on H.ConsigneeId equals p.PersonID into PersonTable
                                                                                from PersonTab in PersonTable.DefaultIfEmpty()
                                                                                join s in db.SaleInvoiceHeader on H.SaleInvoiceHeaderId equals s.SaleInvoiceHeaderId into SaleInvoiceHeaderTable
                                                                                from SaleInvoiceHeaderTab in SaleInvoiceHeaderTable.DefaultIfEmpty()
                                                                                where H.DocTypeId == DocTypeId
                                                                                orderby H.DispatchWaybillHeaderId
                                                                                select new DispatchWaybillHeaderViewModel
            {
                DispatchWaybillHeaderId = H.DispatchWaybillHeaderId,
                DocDate                = H.DocDate,
                DocNo                  = H.DocNo,
                ConsigneeName          = PersonTab.Name,
                SaleInvoiceHeaderDocNo = SaleInvoiceHeaderTab.DocNo,
                WaybillNo              = H.WaybillNo,
                WaybillDate            = H.WaybillDate,
                Remark                 = H.Remark,
                Status                 = H.Status,
                ModifiedBy             = H.ModifiedBy,
                ReviewCount            = H.ReviewCount,
                ReviewBy               = H.ReviewBy,
                Reviewed               = (SqlFunctions.CharIndex(Uname, H.ReviewBy) > 0),
            };

            return(DispatchWaybillHeader);
        }