Example #1
0
 public List <dataProject.Project> getAllProjects()
 {
     try
     {
         using (TLGX_MAPPEREntities1 context = new TLGX_MAPPEREntities1())
         {
             var projectData = (from s in context.Projects
                                orderby s.CREATE_DATE descending
                                select new Models.dataProject.Project
             {
                 Project_Id = s.Project_ID,
                 Project_Name = s.Project_Name,
                 Status = s.Status,
                 Create_Date = s.CREATE_DATE,
                 Create_User = s.CREATE_USER,
                 Update_Date = s.UPDATE_DATE,
                 Update_User = s.UPDATE_USER
             }
                                ).ToList();
             return(projectData);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #2
0
 public List <Approval_Status_Master_Contract_Record> GetApprovalStatusMasterData(string prodtype)
 {
     //DataTable dtRet = new DataTable();
     try
     {
         using (TLGX_MAPPEREntities1 context = new TLGX_MAPPEREntities1())
         {
             //var MasterData = new Approval_Status_Master_Contract();
             var statusmaster = (from ct in context.m_Approval_StatusMaster
                                 where ct.Object_type.Trim().ToUpper() == prodtype.Trim().ToUpper()
                                 orderby ct.Status_hierarchy
                                 select new Approval_Status_Master_Contract_Record
             {
                 Appr_status_id = ct.Appr_status_id,
                 Object_id = ct.Object_id,
                 Object_type = ct.Object_type,
                 Status = ct.Status,
                 Status_hierarchy = ct.Status_hierarchy
             }).ToList();
             //MasterData.Approval_Status_Master_Contract_List = statusmaster;
             //dtRet = ConversionClass.CreateDataTable(statusmaster);
             return(statusmaster);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #3
0
        public int?GetLegacyHotelId(Guid Accomodation_Id)
        {
            int?ret = 0;

            using (TLGX_MAPPEREntities1 context = new TLGX_MAPPEREntities1())
            {
                var acco = (from ac in context.Accommodations
                            where ac.Accommodation_Id == Accomodation_Id
                            select new { ac.Legacy_HTL_ID }).Single();

                ret = acco.Legacy_HTL_ID;
            }

            return(ret);
        }
Example #4
0
        public bool SetApprovalStatusMasterData(List <Approval_Status_Master_Contract_Record> statusmaster)
        {
            bool ret = false;

            try
            {
                using (TLGX_MAPPEREntities1 context = new TLGX_MAPPEREntities1())
                {
                    foreach (Approval_Status_Master_Contract_Record statusrec in statusmaster)
                    {
                        Models.m_Approval_StatusMaster nStatRec = context.m_Approval_StatusMaster.Single(u => u.Appr_status_id == statusrec.Appr_status_id);
                        if (nStatRec == null)
                        {
                            nStatRec = new Models.m_Approval_StatusMaster
                            {
                                Appr_status_id   = Guid.NewGuid(),
                                Object_id        = statusrec.Object_id,
                                Object_type      = statusrec.Object_type,
                                Status           = statusrec.Status,
                                Status_hierarchy = statusrec.Status_hierarchy
                            };
                            context.m_Approval_StatusMaster.Add(nStatRec);
                        }
                        else
                        {
                            nStatRec.Object_id        = statusrec.Object_id;
                            nStatRec.Object_type      = statusrec.Object_type;
                            nStatRec.Status           = statusrec.Status;
                            nStatRec.Status_hierarchy = statusrec.Status_hierarchy;
                        }
                        context.SaveChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(ret);
        }
Example #5
0
        //

        // gets Master City data for a particular Country Id

        public DataTable GetSupplierCountryMapping(SupplierDataMode DataMode, Guid?Supplier_Id, Guid Country_Id)
        {
            DataTable dtRet = new DataTable();

            // need a nice way of handling this mode, talk to rubesh you could probably do it with nullable guid check
            try
            {
                using (TLGX_MAPPEREntities1 myEntity = new TLGX_MAPPEREntities1())
                {
                    var MasterData = new MasterDataContract();
                    if (DataMode == SupplierDataMode.AllSupplierSingleCountry)

                    {
                        var supplierCountryMapping = (from ct in myEntity.m_CountryMapping
                                                      where ct.Country_Id == Country_Id
                                                      orderby ct.SupplierName ascending
                                                      select new CountryMappingE
                        {
                            CountryMapping_ID = ct.CountryMapping_Id,
                            CountryCode = ct.CountryCode,
                            CountryName = ct.CountryName,
                            Edit_Date = ct.Edit_Date,
                            Country_ID = ct.Country_Id,
                            Create_Date = ct.Create_Date,
                            Create_User = ct.Create_User,
                            Edit_User = ct.Edit_User,
                            Status = ct.Status,
                            Supplier_ID = ct.Supplier_Id ?? Guid.Empty,
                            Supplier_Name = ct.SupplierName
                        }).ToList();
                        MasterData.CountryMappingL = supplierCountryMapping;
                        dtRet = ConversionClass.CreateDataTable(supplierCountryMapping);
                    }
                    else if (DataMode == SupplierDataMode.SingleSupplierSingleCountry)
                    {
                        var supplierCountryMapping = (from ct in myEntity.m_CountryMapping
                                                      where
                                                      ct.Country_Id == Country_Id &&
                                                      ct.Supplier_Id == Supplier_Id
                                                      orderby ct.CountryName ascending

                                                      select new CountryMappingE
                        {
                            CountryMapping_ID = ct.CountryMapping_Id,
                            CountryCode = ct.CountryCode,
                            CountryName = ct.CountryName,
                            Edit_Date = ct.Edit_Date,
                            Country_ID = ct.Country_Id,
                            Create_Date = ct.Create_Date,
                            Create_User = ct.Create_User,
                            Edit_User = ct.Edit_User,
                            Status = ct.Status,
                            Supplier_ID = ct.Supplier_Id ?? Guid.Empty,
                            Supplier_Name = ct.SupplierName
                        }).ToList();
                        MasterData.CountryMappingL = supplierCountryMapping;
                        dtRet = ConversionClass.CreateDataTable(supplierCountryMapping);
                    }

                    else if (DataMode == SupplierDataMode.SingleSupplierAllCountry)
                    {
                        var supplierCountryMapping = (from ct in myEntity.m_CountryMapping
                                                      where
                                                      ct.Supplier_Id == Supplier_Id
                                                      orderby ct.CountryName ascending

                                                      select new CountryMappingE
                        {
                            CountryMapping_ID = ct.CountryMapping_Id,
                            CountryCode = ct.CountryCode,
                            CountryName = ct.CountryName,
                            Edit_Date = ct.Edit_Date,
                            Country_ID = ct.Country_Id,
                            Create_Date = ct.Create_Date,
                            Create_User = ct.Create_User,
                            Edit_User = ct.Edit_User,
                            Status = ct.Status,
                            Supplier_ID = ct.Supplier_Id ?? Guid.Empty,
                            Supplier_Name = ct.SupplierName
                        }).ToList();
                        MasterData.CountryMappingL = supplierCountryMapping;
                        dtRet = ConversionClass.CreateDataTable(supplierCountryMapping);
                    }
                    else if (DataMode == SupplierDataMode.AllSupplierAllCountry)
                    {
                        var supplierCountryMapping = (from ct in myEntity.m_CountryMapping

                                                      orderby ct.CountryName ascending

                                                      select new CountryMappingE
                        {
                            CountryMapping_ID = ct.CountryMapping_Id,
                            CountryCode = ct.CountryCode,
                            CountryName = ct.CountryName,
                            Edit_Date = ct.Edit_Date,
                            Country_ID = ct.Country_Id,
                            Create_Date = ct.Create_Date,
                            Create_User = ct.Create_User,
                            Edit_User = ct.Edit_User,
                            Status = ct.Status,
                            Supplier_ID = ct.Supplier_Id ?? Guid.Empty,
                            Supplier_Name = ct.SupplierName
                        }).ToList();
                        MasterData.CountryMappingL = supplierCountryMapping;
                        dtRet = ConversionClass.CreateDataTable(supplierCountryMapping);
                    }
                    ;
                }

                return(dtRet);
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }