public override void Save() { if (string.IsNullOrEmpty(Txt_Name.Text)) { Txt_Name.ErrorText = "يرجى إدخال اسم الشركة !"; return; } else { using (SalesDataContext db = new SalesDataContext()) { Action = "Update"; company_info Company = db.company_info.FirstOrDefault(); if (Company == null) { Company = new company_info(); db.company_info.InsertOnSubmit(Company); Action = "Insetr"; } Company.company_name = Txt_Name.Text; Company.company_address = Txt_Address.Text; Company.company_email = Txt_Email.Text; Company.company_mobile = Txt_Phone.Text; //Company.company_account = Txt_Account.Text; //Company.company_vatnumber = Txt_VatNumber.Text; //Company.companu_logo = Pic_Logo.Image; db.SubmitChanges(); } } base.Save(); }
public ActionResult CreateRestaurant(company_info model) { GrubDBDataContext GrubDB = new GrubDBDataContext(); model.username = User.Identity.Name.Replace("@rose-hulman.edu",""); GrubDB.create_company_info(model.delivery, model.location, model.name, model.orders, model.owner_first, model.owner_last, model.phone_number, model.point_of_contact_email, model.point_of_contact_phone, model.payment_status, model.username); return RedirectToAction("Index", "Home"); }
public override void GetData() { using (SalesDataContext db = new SalesDataContext()) { company_info Company = db.company_info.FirstOrDefault(); { if (!(Company == null)) { Txt_Name.Text = Company.company_name; Txt_Address.Text = Company.company_address; Txt_Phone.Text = Company.company_mobile; Txt_Email.Text = Company.company_email; //Txt_Account.Text = Company.company_account; //Txt_VatNumber.Text = Company.company_vatnumber; //Pic_Logo.Image = Company.companu_logo; } else { return; } } } base.GetData(); }
public ActionResult UpdateInfo(company_info model) { GrubDBDataContext GrubDB = new GrubDBDataContext(); GrubDB.update_company_info(model.id, model.delivery, model.location, model.name, model.orders, model.owner_first, model.owner_last, model.phone_number, model.point_of_contact_email, model.point_of_contact_phone, model.payment_status, model.username); return RedirectToAction("index", "Home"); }