コード例 #1
0
        public int EditPlan(InsertPlanRequest planrequest)
        {
            Plan plan = new Plan();

            plan.Name              = planrequest.Name;
            plan.PlanCode          = planrequest.PlanCode;
            plan.Description       = planrequest.Description;
            plan.Credit            = planrequest.Credit;
            plan.CreditPrice       = planrequest.CreditPrice;
            plan.PlanTypeId        = planrequest.PlanTypeId;
            plan.NoOfAgents        = planrequest.NoOfAgents;
            plan.NoOfDrivers       = planrequest.NoOfDrivers;
            plan.NoOfVehicles      = planrequest.NoOfVehicles;
            plan.PerCreditSMSPrice = planrequest.PerSMSPrice;
            plan.UpdatedDateTime   = DateTime.UtcNow;
            string   date    = planrequest.PlanExpiryDate.ToString();
            DateTime utcDate = DateTime.SpecifyKind(Convert.ToDateTime(date), DateTimeKind.Utc);

            plan.PlanExpiryDate = utcDate; //Convert.ToDateTime(date);
            plan = planService.Editplan(plan);
            return(plan.Id);
        }
コード例 #2
0
        public int InsertPlan(InsertPlanRequest planrequest)
        {
            int result = PlanAlreadyExist(planrequest.PlanCode, planrequest.PlanTypeId);

            if (result != 1)
            {
                return(result);
            }

            Plan plan = new Plan();

            plan.Name                 = planrequest.Name;
            plan.PlanCode             = planrequest.PlanCode;
            plan.Description          = planrequest.Description;
            plan.Credit               = planrequest.Credit;
            plan.CreditPrice          = planrequest.CreditPrice;
            plan.PlanTypeId           = planrequest.PlanTypeId;
            plan.NoOfAgents           = planrequest.NoOfAgents;
            plan.NoOfDrivers          = planrequest.NoOfDrivers;
            plan.NoOfVehicles         = planrequest.NoOfVehicles;
            plan.PerCreditSMSPrice    = planrequest.PerSMSPrice;
            plan.BrainTreePlanName    = planrequest.BrainTreePlan;
            plan.IsActive             = true;
            plan.CreatedDateTime      = DateTime.UtcNow;
            plan.UpdatedDateTime      = DateTime.UtcNow;
            plan.PlanExpiryDateString = planrequest.PlanExpiryDate.ToString();
            // plan.PlanExpiryDate = DateTime.Now.AddMonths(6);
            //"7/10/2013"
            string   date    = planrequest.PlanExpiryDate.ToString();
            DateTime utcDate = DateTime.SpecifyKind(Convert.ToDateTime(date), DateTimeKind.Utc);

            plan.PlanExpiryDate = utcDate; //Convert.ToDateTime(date);
            //plan.PlanExpiryDate = DateTime.ParseExact(planrequest.PlanExpiryDate.ToString(), "yyyy-MM-dd", CultureInfo.InvariantCulture);
            plan = planService.InsertPlan(plan);
            return(plan.Id);
        }