public ActionResult GetWarehouses(string OfficeCode) { DataService2 db = new DataService2(); List <SelectListItem> WarehouseCodes = new List <SelectListItem>(); if (!string.IsNullOrEmpty(OfficeCode)) { List <WarehouseModel> wares = db.GetWarehouse(OfficeCode).ToList(); wares.ForEach(x => { WarehouseCodes.Add(new SelectListItem { Text = x.WarehouseCode.ToString(), Value = x.OfficeCode.ToString() }); }); } return(Json(WarehouseCodes, JsonRequestBehavior.AllowGet)); }
// GET: Settings public ActionResult SetUsers() { DataService2 db = new DataService2(); List <SelectListItem> companyNames = new List <SelectListItem>(); listCompanyModel listCompany = new listCompanyModel(); List <CompanyModel> states = db.GetCompany().ToList(); states.ForEach(x => { companyNames.Add(new SelectListItem { Text = x.CompanyName, Value = x.CompanyCode.ToString() }); }); listCompany.CompanyNames = companyNames; return(View(listCompany)); }
public ActionResult GetOffices(string CompanyCode) { DataService2 db = new DataService2(); List <SelectListItem> OfficeCodes = new List <SelectListItem>(); if (!string.IsNullOrEmpty(CompanyCode)) { List <OfficeModel> offices = db.GetOffice(CompanyCode).ToList(); offices.ForEach(x => { OfficeCodes.Add(new SelectListItem { Text = x.OfficeCode.ToString(), Value = x.CompanyCode.ToString() }); }); } return(Json(OfficeCodes, JsonRequestBehavior.AllowGet)); }
public ActionResult Save(string CompanyName, string CompanyCode, string OfficeCode, string WarehouseCode, string username, string password, string NameSurname) { DataService2 db = new DataService2(); string usrname = HttpContext.User.Identity.Name.ToString(); string userid = db.ReturnScalerData("SELECT UserID FROM Users WHERE Username='******'").ToString(); db.DataCommit("UPDATE Users SET Username='******', password='******', Name='" + NameSurname + "' , Surname='" + NameSurname + "' WHERE UserID='" + userid + "'"); db.DataCommit("UPDATE SetCompany SET CompanyName='" + CompanyName + "', CompanyCode='" + CompanyCode + "',OfficeCode='" + OfficeCode + "', WarehouseCode='" + WarehouseCode + "' WHERE UserID='" + userid + "'"); //db.AddParameter("@CompanyName",CompanyName,DbType.String); //db.AddParameter("@OfficeCode", CompanyName, DbType.String); //db.AddParameter("@WarehouseCode", CompanyName, DbType.String); return(View()); }
private void FunctionComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (ServiceComboBox.SelectedItem.Equals("Primary")) { DataService service = new DataService(); switch (MethodComboBox.Text) { case "Add": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = false; break; } case "Subtract": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = false; break; } case "Multiply": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = false; break; } case "Divide": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = false; break; } case "Concat": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = false; break; } case "Shuffle": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = false; break; } } } else if (ServiceComboBox.SelectedItem.Equals("Secondary")) { DataService2 service = new DataService2(); switch (MethodComboBox.Text) { case "To uppercase": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = true; break; } case "To lowercase": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = true; break; } case "Count letter": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = false; break; } case "Fibonacci": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = true; break; } case "Factorial": { FirstArgumentTextBox.ReadOnly = false; SecondArgumentTextBox.ReadOnly = true; break; } } } }