コード例 #1
0
        public IEnumerable <IndivPricing> GetPricingByNationality(string id)
        {
            string SQL = @"select new_indvprice.new_indvpriceId,new_indvprice.new_pricename,
new_indvprice.new_nationalityName,new_indvprice.new_contractmonths,new_indvprice.new_monthlypaid,new_indvprice.new_periodamount
,new_indvprice.new_everymonth,new_indvprice.new_pricenumber,new_indvprice.new_pricetype,new_nationality,new_prepaid
 from new_indvprice
 where new_nationality='@id'";

            SQL = SQL.Replace("@id", id);

            DataTable           dt   = CRMAccessDB.SelectQ(SQL).Tables[0];
            List <IndivPricing> List = new List <IndivPricing>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                List.Add(new IndivPricing()
                {
                    Id              = dt.Rows[i]["new_indvpriceId"].ToString(),
                    Name            = dt.Rows[i]["new_pricename"].ToString(),
                    Number          = dt.Rows[i]["new_pricenumber"].ToString(),
                    NationalityName = dt.Rows[i]["new_nationalityName"].ToString(),
                    TypeId          = dt.Rows[i]["new_pricetype"].ToString(),
                    TypeName        = OptionsController.GetName("new_indvprice", "new_pricetype", 1025, dt.Rows[i]["new_pricetype"].ToString()),
                    ContractMonths  = MathNumber.RoundDeciaml(dt.Rows[i]["new_contractmonths"].ToString()),
                    PeriodAmount    = MathNumber.RoundDeciaml(dt.Rows[i]["new_periodamount"].ToString()),
                    EveryMonth      = MathNumber.RoundDeciaml(dt.Rows[i]["new_everymonth"].ToString()),
                    MonthelyPaid    = MathNumber.RoundDeciaml(dt.Rows[i]["new_monthlypaid"].ToString()),
                    PrePaid         = MathNumber.RoundDeciaml(dt.Rows[i]["new_monthlypaid"].ToString()),
                });
            }
            return(List);;
        }
コード例 #2
0
        public IEnumerable <IndivPricing> GetIndivPrices(string nationalityId, string professionId)
        {
            string SQL = @"select distinct  * from new_indvprice 
where
new_nationality = '@nationalityId'
and new_profession = '@professionId' and statecode = 0 and new_forweb = 1";

            SQL = SQL.Replace("@nationalityId", nationalityId);
            SQL = SQL.Replace("@professionId", professionId);

            DataTable           dt   = CRMAccessDB.SelectQ(SQL).Tables[0];
            List <IndivPricing> List = new List <IndivPricing>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                List.Add(new IndivPricing()
                {
                    Id              = dt.Rows[i]["new_indvpriceId"].ToString(),
                    Name            = dt.Rows[i]["new_pricename"].ToString(),
                    Number          = dt.Rows[i]["new_pricenumber"].ToString(),
                    NationalityName = dt.Rows[i]["new_nationalityName"].ToString(),
                    TypeId          = dt.Rows[i]["new_pricetype"].ToString(),
                    TypeName        = OptionsController.GetName("new_indvprice", "new_pricetype", 1025, dt.Rows[i]["new_pricetype"].ToString()),
                    ContractMonths  = MathNumber.RoundDeciaml(dt.Rows[i]["new_contractmonths"].ToString()),
                    PeriodAmount    = MathNumber.RoundDeciaml(dt.Rows[i]["new_periodamount"].ToString()),
                    EveryMonth      = MathNumber.RoundDeciaml(dt.Rows[i]["new_everymonth"].ToString()),
                    MonthelyPaid    = MathNumber.RoundDeciaml(dt.Rows[i]["new_monthlypaid"].ToString()),
                    PrePaid         = MathNumber.RoundDeciaml(dt.Rows[i]["new_monthlypaid"].ToString()),
                    NationalityId   = nationalityId,
                    ProfessionId    = professionId,
                });
            }
            return(List);
        }