public ActionResult ArizaKaydiOlustur(ArizaViewModel ariza) { ariza.MusteriId = HttpContext.User.Identity.GetUserId(); var a = new ArizaKaydiRepo().Insert(ariza); if (ariza.UrunFotografFile != null && ariza.UrunFotografFile.ContentLength > 0) { var file = ariza.UrunFotografFile; string fileName = Path.GetFileNameWithoutExtension(file.FileName); string extName = Path.GetExtension(file.FileName); fileName = fileName?.Replace(" ", ""); fileName += Guid.NewGuid().ToString().Replace("-", ""); fileName = Settings.UrlFormatConverter(fileName); var klasorYolu = Server.MapPath("~/Upload/Urunler/" + a); var dosyaYolu = Server.MapPath("~/Upload/Urunler/" + a + "/") + fileName + extName; if (!Directory.Exists(klasorYolu)) { Directory.CreateDirectory(klasorYolu); } file.SaveAs(dosyaYolu); WebImage img = new WebImage(dosyaYolu); //100x80 img.Resize(1000, 800, false); img.AddTextWatermark("Sefer Tası - BAU", "Tomato", opacity: 75, fontSize: 12, fontFamily: "Verdana", horizontalAlign: "Left"); img.Save(dosyaYolu); var uu = new ArizaKaydiRepo().GetById(a); uu.UrunFotografYolu = $"Upload/Urunler/{a}/{fileName}{extName}"; new ArizaKaydiRepo().Update(); } return(RedirectToAction("Index", "Ana")); }
public JsonResult Arizalarim() { var model = new ArizaKaydiRepo().GetAll().OrderBy(x => x.OlusturulmaZamani).Where(x => x.MusteriId == HttpContext.User.Identity.GetUserId()).Select(x => new ArizaViewModel() { Aciklama = x.Aciklama, Adres = x.Adres, MusteriId = x.MusteriId }).ToList(); return(Json(model, JsonRequestBehavior.AllowGet)); }
public JsonResult Arizalar() { var model = new ArizaKaydiRepo().GetAll().OrderBy(x => x.OlusturulmaZamani).Select(x => new ArizaViewModel() { Aciklama = x.Aciklama, Adres = x.Adres, MusteriId = x.MusteriId }).ToList(); return(Json(model, JsonRequestBehavior.AllowGet)); }