public ActionResult Registeration(Registration obj) { try { ShopOwner s = new ShopOwner(); MedicalStore Ms = new MedicalStore(); Ms.ShopName = obj.ShopName; Ms.ShopAddress = obj.ShopAddress; db.MedicalStores.Add(Ms); db.SaveChanges(); s.Name = obj.Name; s.CNIC = obj.CNIC; s.Confirm_Password = obj.Confirm_Password; s.Email = obj.Email; s.ShopId = Ms.ShopId; s.OwnerId = Ms.ShopId; db.ShopOwners.Add(s); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public ActionResult Create(StaffViewModel obj) { var Ownerid = (int)Session["OwnerId"]; try { Staff s = new Staff(); s.FirstName = obj.FirstName; s.LastName = obj.LastName; s.DateOfBirth = obj.DateOfBirth; s.Join_Date = obj.Join_Date; s.OwnerId = Ownerid; s.Post = obj.Post; s.CNIC = obj.CNIC; s.Password = obj.Password; s.Email = obj.Email; db.Staffs.Add(s); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public ActionResult Create(SalaryViewModel obj) { try { Salary s = new Salary(); s.Scale = obj.Scale; s.SalaryAmount = obj.SalaryAmount; db.Salaries.Add(s); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public ActionResult Create(CategoryViewModel obj) { try { Category C1 = new Category(); C1.Name = obj.Name; C1.Type = obj.Type; C1.Description = obj.Description; db.Categories.Add(C1); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public ActionResult Create(int id, AttendenceViewModel obj) { try { Attendence Att = new Attendence(); Att.Date = obj.Date; Att.Status = obj.Status.ToString(); Att.StaffID = id; db.Attendences.Add(Att); db.SaveChanges(); // return RedirectToAction("Index"); ViewBag.Message = "Attendence has been Marked "; return(RedirectToAction("Index")); } catch { return(View()); } }
// POST: Salesman/Create public ActionResult Create(SalaryStatusViewModel obj) { try { SalaryStatu s = new SalaryStatu(); s.ID = obj.ID; s.SalaryID = obj.SalaryID; s.StaffID = obj.StaffID; s.Status = obj.Status; s.PaidDate = obj.PaidDate; db.SalaryStatus.Add(s); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public ActionResult Create(CompnayViewModel obj) { try { // TODO: Add insert logic here Comapny C1 = new Comapny(); C1.CompanyName = obj.Name; C1.CompanyType = obj.CompanyType; C1.CompanyAddress = obj.CompanyAddress; db.Comapnies.Add(C1); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public ActionResult Create(SalesmanViewModel obj) { try { Salesman s = new Salesman(); s.Name = obj.Name; s.CNIC = obj.CNIC; s.Phone = obj.Phone; s.CompanyID = obj.CompanyID; s.StockID = obj.StockID; db.Salesmen.Add(s); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public ActionResult Create(SellsViewModel obj) { try { Sell s = new Sell(); s.MedId = obj.MedId; s.Price = obj.Price; s.StaffId = obj.StaffId; s.CustomerName = obj.CustomerName; s.Date = obj.Date; db.Sells.Add(s); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public ActionResult Create(MedicineViewModel obj) { try { Medicine s = new Medicine(); s.MedicineName = obj.MedicineName; s.Description = obj.Description; s.Measurement = obj.Measurement; s.Price = obj.Price; s.StockID = obj.StockID; s.CategoryID = obj.CategoryID; db.Medicines.Add(s); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public ActionResult Create(StockViewModel obj) { var Ownerid = (int)Session["OwnerId"]; try { Stock s = new Stock(); s.StockNumber = obj.StockNumber; s.StockType = obj.StockType; s.Stockitem = obj.Stockitem; s.Description = obj.Description; s.OwnerId = Ownerid; s.Quantity = obj.Quantity; db.Stocks.Add(s); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }