Exemple #1
0
        public List <FundingLineEvent> GetEvents(FundingLine fl)
        {
            List <FundingLineEvent> list = new List <FundingLineEvent>();
            const string            q    = @"SELECT id,
                                    code,
                                    amount,
                                    direction, 
                                    deleted,
                                    creation_date,
                                    type 
                               FROM dbo.FundingLineEvents
                               WITH (READUNCOMMITTED)
                               WHERE fundingline_id = @id
                               ORDER BY creation_date DESC, id DESC";

            using (SqlConnection conn = GetConnection())
                using (OpenCbsCommand c = new OpenCbsCommand(q, conn))
                {
                    c.AddParam("@id", fl.Id);
                    using (OpenCbsReader r = c.ExecuteReader())
                    {
                        if (null == r || r.Empty)
                        {
                            return(list);
                        }
                        while (r.Read())
                        {
                            FundingLineEvent e = new FundingLineEvent();
                            e.Id           = r.GetInt("id");
                            e.Code         = r.GetString("code");
                            e.Amount       = r.GetMoney("amount");
                            e.Movement     = (OBookingDirections)r.GetSmallInt("direction");
                            e.IsDeleted    = r.GetBool("deleted");
                            e.CreationDate = r.GetDateTime("creation_date");
                            e.Type         = (OFundingLineEventTypes)r.GetSmallInt("type");
                            e.FundingLine  = fl;
                            list.Add(e);
                        }
                    }
                }
            return(list);
        }
        private Project GetProject(OpenCbsReader reader)
        {
            Project project = new Project();

            project.Id            = reader.GetInt("id");
            project.ProjectStatus = (OProjectStatus)reader.GetSmallInt("status");
            project.Code          = reader.GetString("code");
            project.Name          = reader.GetString("name");
            project.Aim           = reader.GetString("aim");
            project.BeginDate     = reader.GetDateTime("begin_date");
            project.Abilities     = reader.GetString("abilities");
            project.Experience    = reader.GetString("experience");
            project.Market        = reader.GetString("market");
            project.Concurrence   = reader.GetString("concurrence");
            project.Purpose       = reader.GetString("purpose");

            project.CorporateName          = reader.GetString("corporate_name");
            project.CorporateJuridicStatus = reader.GetString("corporate_juridicStatus");
            project.CorporateFiscalStatus  = reader.GetString("corporate_FiscalStatus");
            project.CorporateSIRET         = reader.GetString("corporate_siret");
            project.CorporateRegistre      = reader.GetString("corporate_registre");
            project.CorporateCA            = reader.GetMoney("corporate_CA");

            project.CorporateNbOfJobs                 = reader.GetNullInt("corporate_nbOfJobs");
            project.CorporateFinancialPlanType        = reader.GetString("corporate_financialPlanType");
            project.CorporateFinancialPlanAmount      = reader.GetMoney("corporateFinancialPlanAmount");
            project.CorporateFinancialPlanTotalAmount = reader.GetMoney("corporate_financialPlanTotalAmount");
            project.Address = reader.GetString("address");
            project.City    = reader.GetString("city");
            project.ZipCode = reader.GetString("zipCode");
            int?districtId = reader.GetNullInt("district_id");

            if (districtId.HasValue)
            {
                project.District = new District {
                    Id = districtId.Value
                }
            }
            ;

            project.HomePhone     = reader.GetString("home_phone");
            project.PersonalPhone = reader.GetString("personalPhone");
            project.Email         = reader.GetString("Email");
            project.HomeType      = reader.GetString("hometype");

            return(project);
        }
Exemple #3
0
        private Project GetProject(OpenCbsReader reader)
        {
            Project project = new Project();
            project.Id = reader.GetInt("id");
            project.ProjectStatus = (OProjectStatus)reader.GetSmallInt("status");
            project.Code = reader.GetString("code");
            project.Name = reader.GetString("name");
            project.Aim = reader.GetString("aim");
            project.BeginDate = reader.GetDateTime("begin_date");
            project.Abilities = reader.GetString("abilities");
            project.Experience = reader.GetString("experience");
            project.Market = reader.GetString("market");
            project.Concurrence = reader.GetString("concurrence");
            project.Purpose = reader.GetString("purpose");

            project.CorporateName = reader.GetString("corporate_name");
            project.CorporateJuridicStatus = reader.GetString("corporate_juridicStatus");
            project.CorporateFiscalStatus = reader.GetString("corporate_FiscalStatus");
            project.CorporateSIRET = reader.GetString("corporate_siret");
            project.CorporateRegistre = reader.GetString("corporate_registre");
            project.CorporateCA = reader.GetMoney("corporate_CA");

            project.CorporateNbOfJobs = reader.GetNullInt("corporate_nbOfJobs");
            project.CorporateFinancialPlanType = reader.GetString("corporate_financialPlanType");
            project.CorporateFinancialPlanAmount = reader.GetMoney("corporateFinancialPlanAmount");
            project.CorporateFinancialPlanTotalAmount = reader.GetMoney("corporate_financialPlanTotalAmount");
            project.Address = reader.GetString("address");
            project.City = reader.GetString("city");
            project.ZipCode = reader.GetString("zipCode");
            int? districtId = reader.GetNullInt("district_id");
            if (districtId.HasValue)
                project.District = new District { Id = districtId.Value };

            project.HomePhone = reader.GetString("home_phone");
            project.PersonalPhone = reader.GetString("personalPhone");
            project.Email = reader.GetString("Email");
            project.HomeType = reader.GetString("hometype");

            return project;
        }