// GET: CabsTaxis public ActionResult Pay(long?prime, long?vid, long?id, string userid, string amnt) { CabsTaxi forsale = db.CabsTaxis.Find(id); DateTime _date = Convert.ToDateTime(DateTime.Now); _date = _date.AddDays(365); forsale.UserId = User.Identity.GetUserId(); forsale.Status = true; forsale.Date = DateTime.Now; forsale.EndDate = _date; forsale.StratDate = DateTime.Now; db.Entry(forsale).State = EntityState.Modified; db.SaveChanges(); var ids = DateTime.Now.ToString("mmddyyyy"); RazorpayClient client = new RazorpayClient(RazorPayConst.Api_Key, RazorPayConst.Key_Secret); Dictionary <string, object> options = new Dictionary <string, object>(); options.Add("amount", amnt); // amount in the smallest currency unit options.Add("receipt", "order_id" + ids); options.Add("currency", "INR"); options.Add("payment_capture", "1"); Order order = client.Order.Create(options); List <Order> payments = client.Order.All(); string datas = payments[0]["id"]; ViewBag.receipt = datas; return(View()); }
public ActionResult DeleteConfirmed(long id) { CabsTaxi cabsTaxi = db.CabsTaxis.Find(id); db.CabsTaxis.Remove(cabsTaxi); db.SaveChanges(); return(RedirectToAction("Index", "MyAccount")); }
public ActionResult UpdateStatusFalse(long?id) { CabsTaxi forsale = db.CabsTaxis.Find(id); forsale.Status = false; db.Entry(forsale).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("AddsManage", "MyAccount")); }
// GET: CabsTaxis/Edit/5 public ActionResult Edit(long?id) { ViewBag.VehicleCategory = db.VehicleCategory.ToList(); ViewBag.VehicleType = db.VehicleType.ToList(); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CabsTaxi cabsTaxi = db.CabsTaxis.Find(id); if (cabsTaxi == null) { return(HttpNotFound()); } return(View(cabsTaxi)); }
// GET: CabsTaxis/Details/5 public ActionResult Details(string id) { id = id == null ? "" : id; SqlParameter[] Parameters = { new SqlParameter("@CabTaxiId", id.ToString()) }; ViewBag.data = db.Database.SqlQuery <CarsTaxiModel>(" [dbo].[spGetListingData_CarsTaxi_Details] @CabTaxiId", Parameters).ToList(); long ids = Convert.ToInt64(id); CabsTaxi forsale = db.CabsTaxis.Find(ids); forsale.Views = forsale.Views + 1; db.Entry(forsale).State = EntityState.Modified; db.SaveChanges(); return(View()); }
public ActionResult Edit([Bind(Include = "UserId,EndDate,status,StratDate,CabTaxiId,VId,UserId,Title,About,VehicleCategoryId,VehicleTypeId,Location,DriverAge,YearofExperience,VehicleBrand,VehicleModelName,VehicleYear,SeatingCapacity,MinimumCharge,MobileNumber,LandPhone,Image1,Image2,Image3,Date,Views,Status")] CabsTaxi cabsTaxi, HttpPostedFileBase file1, HttpPostedFileBase file2, HttpPostedFileBase file3) { if (ModelState.IsValid) { if (file1 != null) { //file1.SaveAs(HttpContext.Server.MapPath("~/Images/")+ file1.FileName); //realEstate.Image1 = "/Images/"+file1.FileName; string watermarkText = "© Vooqq.Com"; //Get the file name. string fileName = Path.GetFileNameWithoutExtension(file1.FileName); //Read the File into a Bitmap. using (Bitmap bmp = new Bitmap(file1.InputStream, false)) { using (Graphics grp = Graphics.FromImage(bmp)) { //Set the Color of the Watermark text. Brush brush = new SolidBrush(Color.DimGray); //Set the Font and its size. Font font = new System.Drawing.Font("Arial", 30, FontStyle.Bold, GraphicsUnit.Pixel); //Determine the size of the Watermark text. SizeF textSize = new SizeF(); textSize = grp.MeasureString(watermarkText, font); //Position the text and draw it on the image. Point position = new Point((bmp.Width - ((int)textSize.Width + 10)), (bmp.Height - ((int)textSize.Height + 10))); grp.DrawString(watermarkText, font, brush, position); using (MemoryStream memoryStream = new MemoryStream()) { //Save the Watermarked image to the MemoryStream. bmp.Save(HttpContext.Server.MapPath("~/Images/") + file1.FileName); cabsTaxi.Image1 = "/Images/" + file1.FileName; } } } } else if (cabsTaxi.Image1 != null) { } else { cabsTaxi.Image1 = "/Images/nullimage.jpg"; } if (file2 != null) { string watermarkText = "© Vooqq.Com"; //Get the file name. string fileName = Path.GetFileNameWithoutExtension(file2.FileName); //Read the File into a Bitmap. using (Bitmap bmp = new Bitmap(file2.InputStream, false)) { using (Graphics grp = Graphics.FromImage(bmp)) { //Set the Color of the Watermark text. Brush brush = new SolidBrush(Color.DimGray); //Set the Font and its size. Font font = new System.Drawing.Font("Arial", 30, FontStyle.Bold, GraphicsUnit.Pixel); //Determine the size of the Watermark text. SizeF textSize = new SizeF(); textSize = grp.MeasureString(watermarkText, font); //Position the text and draw it on the image. Point position = new Point((bmp.Width - ((int)textSize.Width + 10)), (bmp.Height - ((int)textSize.Height + 10))); grp.DrawString(watermarkText, font, brush, position); using (MemoryStream memoryStream = new MemoryStream()) { //Save the Watermarked image to the MemoryStream. bmp.Save(HttpContext.Server.MapPath("~/Images/") + file2.FileName); cabsTaxi.Image2 = "/Images/" + file2.FileName; } } } } else if (cabsTaxi.Image2 != null) { } else { cabsTaxi.Image2 = "/Images/nullimage.jpg"; } if (file3 != null) { string watermarkText = "© Vooqq.Com"; //Get the file name. string fileName = Path.GetFileNameWithoutExtension(file3.FileName); //Read the File into a Bitmap. using (Bitmap bmp = new Bitmap(file3.InputStream, false)) { using (Graphics grp = Graphics.FromImage(bmp)) { //Set the Color of the Watermark text. Brush brush = new SolidBrush(Color.DimGray); //Set the Font and its size. Font font = new System.Drawing.Font("Arial", 30, FontStyle.Bold, GraphicsUnit.Pixel); //Determine the size of the Watermark text. SizeF textSize = new SizeF(); textSize = grp.MeasureString(watermarkText, font); //Position the text and draw it on the image. Point position = new Point((bmp.Width - ((int)textSize.Width + 10)), (bmp.Height - ((int)textSize.Height + 10))); grp.DrawString(watermarkText, font, brush, position); using (MemoryStream memoryStream = new MemoryStream()) { //Save the Watermarked image to the MemoryStream. bmp.Save(HttpContext.Server.MapPath("~/Images/") + file3.FileName); cabsTaxi.Image3 = "/Images/" + file3.FileName; } } } } else if (cabsTaxi.Image3 != null) { } else { cabsTaxi.Image3 = "/Images/nullimage.jpg"; } cabsTaxi.Date = DateTime.Now; db.Entry(cabsTaxi).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "MyAccount")); } return(View(cabsTaxi)); }