public ActionResult LoginForPayment(int?planid)
        {
            try
            {
                JobDbContext2 _db    = new JobDbContext2();
                var           result = _db.PlanRate.SqlQuery(@"exec Usp_GetplanDetailById 
                @PlanID",
                                                             new SqlParameter("@PlanID", planid)).ToList <PlanRate>();
                PlanRate data = new PlanRate();
                data = result.FirstOrDefault();

                if (data == null)
                {
                    return(Json("No plans are available"));
                }
                else
                {
                    var tt = data.PlanAmount + data.OTIAmount;
                    Session["PlanName"]   = data.PlanName;
                    Session["PlanDesc"]   = data.PlanDesc;
                    Session["PlanAmount"] = data.PlanAmount;
                    Session["Total"]      = tt;
                    Session["PlanID"]     = data.PlanID;
                    return(View());
                }
            }

            catch (Exception ex)
            {
                return(Json(ex.Message));
            }
        }
        public ServiceResult <PlanRate> Post([FromBody] PlanRate model)
        {
            ServiceResult <PlanRate> result = null;
            var validatorResult             = validator.Validate(model);

            if (validatorResult.IsValid)
            {
                try
                {
                    result = this.appService.Insert(model);
                }
                catch (Exception ex)
                {
                    result         = new ServiceResult <PlanRate>();
                    result.Errors  = new string[] { ex.Message };
                    result.Success = false;
                }
            }
            else
            {
                result         = new ServiceResult <PlanRate>();
                result.Errors  = validatorResult.GetErrors();
                result.Success = false;
            }

            return(result);
        }
        public PlanRate Insert(PlanRate planRate)
        {
            var id = connection.Query <int>(PlanRateQuerys.Insert, planRate).Single();

            planRate.PlanRateId = id;
            return(planRate);
        }
Example #4
0
        public ServiceResult <bool> Delete(PlanRate planRate)
        {
            var deleted = this.repository.Delete(planRate);

            return(new ServiceResult <bool>
            {
                Success = true,
                Result = deleted
            });
        }
Example #5
0
        public ServiceResult <PlanRate> Insert(PlanRate planRate)
        {
            var PlanRateInserted = this.repository.Insert(planRate);

            return(new ServiceResult <PlanRate>
            {
                Success = true,
                Result = PlanRateInserted
            });
        }
        public ServiceResult <bool> Put(int id, [FromBody] PlanRate model)
        {
            ServiceResult <bool> result;

            try
            {
                result = this.appService.Delete(model);
            }
            catch (Exception ex)
            {
                result         = new ServiceResult <bool>();
                result.Errors  = new string[] { ex.Message };
                result.Success = false;
            }
            return(result);
        }
        public ActionResult Registration(int?planid)
        {
            try
            {
                if (planid > 0)
                {
                    if (Session["RegID"] != null)
                    {
                        Response.Redirect("PaymentCheckout", false);
                    }
                    JobDbContext2 _db    = new JobDbContext2();
                    var           result = _db.PlanRate.SqlQuery(@"exec Usp_GetplanDetailById 
                @PlanID",
                                                                 new SqlParameter("@PlanID", planid)).ToList <PlanRate>();
                    PlanRate data = new PlanRate();
                    data = result.FirstOrDefault();

                    if (data == null)
                    {
                        return(Json("No plans are available"));
                    }
                    else
                    {
                        var tt = data.PlanAmount + data.OTIAmount;
                        Session["PlanName"]   = data.PlanName;
                        Session["PlanDesc"]   = data.PlanDesc;
                        Session["PlanAmount"] = data.PlanAmount;
                        Session["Total"]      = tt;
                        Session["PlanID"]     = data.PlanID;
                    }
                }
            }

            catch (Exception ex)
            {
                string message = ex.Message;
                return(Json(message));
            }
            return(View());
        }
Example #8
0
 public ServiceResult <bool> Delete(PlanRate planRate)
 {
     return(this.service.Delete(planRate));
 }
Example #9
0
 public ServiceResult <PlanRate> Insert(PlanRate planRate)
 {
     return(this.service.Insert(planRate));
 }
        public bool Delete(PlanRate planRate)
        {
            var affectedRows = connection.Execute(PlanRateQuerys.Delete, planRate);

            return(affectedRows > 0);
        }