Esempio n. 1
0
 public ActionResult UploadFile(HttpPostedFileBase billfile, [Bind(Include = "MRP,GST,Flag")] GSTINformation gSTINformation)
 {
     if (IsValidExtension(billfile.FileName))
     {
         try
         {
             if (billfile.ContentLength > 0)
             {
                 string _FileName = Path.GetFileName(billfile.FileName);
                 string _path     = Path.Combine(Server.MapPath("~/UploadedFiles"), _FileName);
                 billfile.SaveAs(_path);
                 gSTINformation.Bill = _FileName;
                 gSTINformation.Uid  = Convert.ToInt32(Session["Uid"]);
                 if (ModelState.IsValid)
                 {
                     db.GSTINformations.Add(gSTINformation);
                     db.SaveChanges();
                 }
             }
             ViewBag.Message = "File Uploaded Successfully!!";
             return(View("Gstrate"));
         }
         catch
         {
             ViewBag.Message = "File upload failed!!";
             return(View("Gstrate"));
         }
     }
     else
     {
         ViewBag.Message = "Please upload .jpeg,.png,.gif,.jpg,.bmp image only";
     }
     return(View("Gstrate"));
 }
Esempio n. 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            GSTINformation gSTINformation = db.GSTINformations.Find(id);

            db.GSTINformations.Remove(gSTINformation);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
 public ActionResult Edit([Bind(Include = "Gid,MRP,Uid,GST,Bill,Flag")] GSTINformation gSTINformation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(gSTINformation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Uid = new SelectList(db.Registrations, "Uid", "FirstName", gSTINformation.Uid);
     return(View(gSTINformation));
 }
Esempio n. 4
0
        public ActionResult Create([Bind(Include = "Gid,MRP,Uid,GST,Bill")] GSTINformation gSTINformation)
        {
            if (ModelState.IsValid)
            {
                db.GSTINformations.Add(gSTINformation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Uid = new SelectList(db.Registrations, "Uid", "FirstName", gSTINformation.Uid);
            return(View(gSTINformation));
        }
Esempio n. 5
0
        // GET: GSTINformations/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GSTINformation gSTINformation = db.GSTINformations.Find(id);

            if (gSTINformation == null)
            {
                return(HttpNotFound());
            }
            return(View(gSTINformation));
        }
Esempio n. 6
0
        // GET: GSTINformations/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GSTINformation gSTINformation = db.GSTINformations.Find(id);

            if (gSTINformation == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Uid = new SelectList(db.Registrations, "Uid", "FirstName", gSTINformation.Uid);
            return(View(gSTINformation));
        }
 public ActionResult DGSTbill(GSTINformation gst)
 {
     if (Session["Admin"] != null)
     {
         using (TaxSystemEntities1 db = new TaxSystemEntities1())
         {
             var x = Convert.ToInt32(Request["item.Uid"]);
             ViewBag.email    = Request["item.Email"].ToString();
             Session["Email"] = Request["item.Email"].ToString();
             var data = db.GSTINformations.Where(m => m.Registration.Uid.Equals(x)).ToList();
             if (data == null)
             {
                 return(View());
             }
             return(View(data));
         }
     }
     else
     {
         return(RedirectToAction("Index", "AdminInformations"));
     }
 }