示例#1
0
        // GET: Bills/Create
        public ActionResult CreateAccount_bill()
        {
            string date  = DateTime.Now.ToString("MM/dd/yyyy hh:mm tt");
            string month = DateTime.Now.ToString("MMMM");

            DBmodel payrollentities = new DBmodel();

            Biil biil = new Biil();

            biil.Date = date;
            return(View(biil));
        }
示例#2
0
 public ActionResult CreateAccount_bill(Biil biil)
 {
     try
     {
         using (DBmodel payrollentities = new DBmodel())
         {
             payrollentities.Biils.Add(biil);
             payrollentities.SaveChanges();
         }
         return(RedirectToAction("BillList"));
     }
     catch
     {
         return(View());
     }
 }
示例#3
0
        public ActionResult EditDetails_bill(int id, Biil biil)
        {
            try
            {
                using (DBmodel payrollentities = new DBmodel())
                {
                    payrollentities.Entry(biil).State = EntityState.Modified;
                    payrollentities.SaveChanges();
                }

                return(RedirectToAction("BillList"));
            }
            catch
            {
                return(View());
            }
        }
示例#4
0
 public ActionResult DeleteDetails_bill(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         using (DBmodel payrollentities = new DBmodel())
         {
             Biil biil = payrollentities.Biils.Where(x => x.BillId == id).FirstOrDefault();
             payrollentities.Biils.Remove(biil);
             payrollentities.SaveChanges();
         }
         return(RedirectToAction("BillList"));
     }
     catch
     {
         return(View());
     }
 }