Beispiel #1
0
 public bool AddMatrimony(Matrimony matrimony)
 {
     //var existingBaptism = _entities.Matrimonies.FirstOrDefault(m => m.BapitsmNumber == baptism.BapitsmNumber);
     _entities.Matrimonies.Add(matrimony);
     _entities.SaveChanges();
     return(true);
 }
        public ActionResult DeleteConfirmed(long id)
        {
            Matrimony matrimony = db.Matrimony.Find(id);

            db.Matrimony.Remove(matrimony);
            db.SaveChanges();
            return(RedirectToAction("Index", "MyAccount"));
        }
 public ActionResult EditMatrimony(MatrimonyViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return(View(model));
     }
     try
     {
         var matrimony = new Matrimony
         {
             Id                  = model.Id,
             DateOfMarriage      = model.DateOfMarriage,
             PlaceOfMarriage     = model.PlaceOfMarriage,
             BrideFullName       = model.BrideFullName,
             GroomFullName       = model.GroomFullName,
             BrideAddress        = model.BrideAddress,
             GroomAddress        = model.GroomAddress,
             BrideAge            = model.BrideAge,
             GroomAge            = model.GroomAge,
             BrideBaptismPlace   = model.BrideBaptismPlace,
             BrideBaptismDate    = model.BrideBaptismDate,
             BrideBaptismNo      = model.BrideBaptismNo,
             GroomBaptismPlace   = model.GroomBaptismPlace,
             GroomBaptismDate    = model.GroomBaptismDate,
             GroomBaptismNo      = model.GroomBaptismNo,
             AssistingPriest     = model.AssistingPriest,
             BannDetails         = model.BannDetails,
             BrideParentName     = model.BrideParentName,
             BrideParentHomeTown = model.BrideParentHomeTown,
             GroomParentName     = model.GroomParentName,
             GroomParentHomeTown = model.GroomParentHomeTown,
             Witness1            = model.Witness1,
             Witness2            = model.Witness2,
             Remark              = model.Remark,
             Deleted             = 0,
             UpdateDate          = DateTime.Now
         };
         if (_sacramentRepository.UpdateMatrimony(matrimony))
         {
             var returnData = new ReturnData
             {
                 HasValue = true,
                 Message  = "Marriage record was successfully updated"
             };
             TempData["returnMessage"] = returnData;
             return(RedirectToAction("Matrimony"));
         }
         ModelState.AddModelError(string.Empty, "There was an error completing the registration, Please check if the record is correct");
         return(View(model));
     }
     catch (Exception e)
     {
         //error occured
         ModelState.AddModelError(string.Empty, "There was an error completing the registration, Please try again later");
         ErrorUtil.LogError(e);
         return(View(model));
     }
 }
        public ActionResult UpdateStatusFalse(long?id)
        {
            Matrimony forsale = db.Matrimony.Find(id);

            forsale.Status          = false;
            db.Entry(forsale).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("AddsManage", "MyAccount"));
        }
Beispiel #5
0
        public bool UpdateMatrimony(Matrimony matrimony)
        {
            var existingMatrimony = _entities.Matrimonies.FirstOrDefault(m => m.Id == matrimony.Id);

            if (existingMatrimony != null)
            {
                matrimony.CreateDate = existingMatrimony.CreateDate;
                _entities.Entry(existingMatrimony).CurrentValues.SetValues(matrimony);
                _entities.SaveChanges();
                return(true);
            }
            return(false);
        }
        public ActionResult Pay(long?prime, long?vid, long?id, string userid, string amnt)
        {
            Matrimony forsale = db.Matrimony.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;

            RazorPayPaymentDetails clients = new RazorPayPaymentDetails();

            clients.Amount          = Convert.ToDouble(amnt);
            clients.Currency        = "INR";
            clients.Captured        = "Paid";
            clients.RazorpayOrderId = ids;
            clients.MerchantOrderId = "vooq.com";
            clients.PaymentId       = User.Identity.GetUserId();
            clients.PaymentDate     = DateTime.Now;
            db.RazorPayPaymentDetails.Add(clients);
            db.SaveChanges();

            return(View());
        }
        // GET: Matrimonies/Details/5
        public ActionResult Details(string id)
        {
            id = id == null ? "" : id;
            SqlParameter[] Parameters =
            {
                new SqlParameter("@MatrimonyId", id.ToString())
            };
            ViewBag.data = db.Database.SqlQuery <MatrimoniesModel>(" [dbo].[spGetListingData_Matrimonies_Details] @MatrimonyId", Parameters).ToList();

            long      ids     = Convert.ToInt64(id);
            Matrimony forsale = db.Matrimony.Find(ids);

            forsale.Views           = forsale.Views + 1;
            db.Entry(forsale).State = EntityState.Modified;
            db.SaveChanges();
            return(View());
        }
        // GET: Matrimonies/Edit/5
        public ActionResult Edit(long?id)
        {
            ViewBag.Religion          = db.Religion.ToList();
            ViewBag.M_AgeCategory     = db.M_AgeCategory.ToList();
            ViewBag.M_MaritalStatus   = db.M_MaritalStatus.ToList();
            ViewBag.M_PhysicalStatus  = db.M_PhysicalStatus.ToList();
            ViewBag.M_BodySkinTone    = db.M_BodySkinTone.ToList();
            ViewBag.MatrimonyCategory = db.MatrimonyCategory.ToList();


            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Matrimony matrimony = db.Matrimony.Find(id);

            if (matrimony == null)
            {
                return(HttpNotFound());
            }
            return(View(matrimony));
        }
        public ActionResult Edit([Bind(Include = "UserId,EndDate,status,StratDate,MatrimonyId,VId,UserId,Title,DateOfBirth,MatrimonyCategoryId,M_AgeCategoryId,M_MaritalStatusId,M_PhysicalStatusId,M_BodySkinToneId,ReligionId,Community,SubCommunity,Nakshatra,Job,Qualification,Languages,Email,Description,LandPhone,Mobile,Location,Image1,Image2,Image3,Date,Views,Status")] Matrimony matrimony, HttpPostedFileBase file1, HttpPostedFileBase file2, HttpPostedFileBase file3)
        {
            ViewBag.Religion          = db.Religion.ToList();
            ViewBag.M_AgeCategory     = db.M_AgeCategory.ToList();
            ViewBag.M_MaritalStatus   = db.M_MaritalStatus.ToList();
            ViewBag.M_PhysicalStatus  = db.M_PhysicalStatus.ToList();
            ViewBag.M_BodySkinTone    = db.M_BodySkinTone.ToList();
            ViewBag.MatrimonyCategory = db.MatrimonyCategory.ToList();

            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);
                                matrimony.Image1 = "/Images/" + file1.FileName;
                            }
                        }
                    }
                }
                else if (matrimony.Image1 != null)
                {
                }
                else
                {
                    matrimony.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);
                                matrimony.Image2 = "/Images/" + file2.FileName;
                            }
                        }
                    }
                }
                else if (matrimony.Image2 != null)
                {
                }
                else
                {
                    matrimony.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);
                                matrimony.Image3 = "/Images/" + file3.FileName;
                            }
                        }
                    }
                }
                else if (matrimony.Image3 != null)
                {
                }
                else
                {
                    matrimony.Image3 = "/Images/nullimage.jpg";
                }
                matrimony.Date            = DateTime.Now;
                db.Entry(matrimony).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index", "MyAccount"));
            }
            return(View(matrimony));
        }