Пример #1
0
        public IEnumerable <Complaint> GetComplaintsDetails(string id, string status)
        {
            string Sql = @"select new_name,new_contracttype,new_problemcase,new_compalinsource
,new_cshindivcontractid,new_problemdetails ,new_HIndvContract.new_HIndivClintnameName,new_HIndvContract.new_HIndivClintname
,dateadd  (hh,3,new_csindvsector.CreatedOn)
,CONVERT(VARCHAR(20),dateadd(hh, 3, new_csindvsector.CreatedOn ),103) as edate,FORMAT(CAST(dateadd(hh, 3, new_csindvsector.CreatedOn ) AS DATETIME),'hh:mm tt') as etime,new_csindvsector.statuscode
,new_HIndvContract.new_ContractNumber
from new_csindvsector,new_HIndvContract
where new_csindvsector.new_cshindivcontractid=new_HIndvContract.new_HIndvContractId
and new_HIndvContract.new_HIndivClintname='@id' and new_csindvsector.statuscode='@stat' order by new_csindvsector.CreatedOn desc";


            Sql = Sql.Replace("@id", id);
            Sql = Sql.Replace("@stat", status);

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

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                List.Add(new Complaint {
                    Code           = dt.Rows[i]["new_name"].ToString(),
                    Category       = OptionsController.GetName("new_csindvsector", "new_contracttype", 1025, dt.Rows[i]["new_contracttype"].ToString()),
                    Type           = OptionsController.GetName("new_csindvsector", "new_problemcase", 1025, dt.Rows[i]["new_problemcase"].ToString()),
                    Date           = dt.Rows[i]["edate"].ToString(),
                    Time           = dt.Rows[i]["etime"].ToString(),
                    Description    = dt.Rows[i]["new_problemdetails"].ToString(),
                    CustomerName   = dt.Rows[i]["new_HIndivClintnameName"].ToString(),
                    Status         = OptionsController.GetName("new_csindvsector", "statuscode", 1025, dt.Rows[i]["statuscode"].ToString()),
                    ContractNumber = dt.Rows[i]["new_ContractNumber"].ToString(),
                });
            }

            return(List);
        }
Пример #2
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);;
        }
Пример #3
0
        public string Create(string Company, int sector, string Description, string phone, int who = 1)
        {
            // select new_nationalityid,new_districtid,new_profrequiredid,new_cityid from lead
            //


            Entity Lead = new Entity("lead");

            Lead["new_sector"]  = new OptionSetValue(1);
            Lead["companyname"] = Company;
            Lead["firstname"]   = " طلب قطاع اعمال لشركة" + Company;

            Lead["new_company_busienss"] = OptionsController.GetName("account", "industrycode", 1025, sector.ToString());
            // Lead["new_companysector"] = new OptionSetValue(sector);
            Lead["mobilephone"] = phone;
            Lead["description"] = Description;


            Guid id = GlobalCode.Service.Create(Lead);


            return(id.ToString());
        }