private void saveAuxiliar() { if (ProductText.SelectedItem != null & ProcessText.SelectedItem != null & OperationTypeText.SelectedItem != null) { if (ProductText.SelectedItem.Value != "" & ProcessText.SelectedItem.Value != "" & OperationTypeText.SelectedItem.Value != "" & OperationText.Text != "") { OperationService operationService = new OperationService(); OperationInsertView insertOperation = new OperationInsertView(); insertOperation.OperationName = OperationText.Text; insertOperation.OperationTypeId = Int32.Parse(OperationTypeText.SelectedItem.Value); insertOperation.ProcessId = Int32.Parse(ProcessText.SelectedItem.Value); insertOperation.ProductLineId = Int32.Parse(ProductText.SelectedItem.Value); CUDView crud = operationService.insertOperation(insertOperation); int idOperation = Int32.Parse(crud.insertPK); if (crud.insert == false) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Could not insert the Operation')", true); } else { List<OperationEquipmentView> insertlist = (List<OperationEquipmentView>)(HttpContext.Current.Session["listUpdateEquipment"]); foreach (OperationEquipmentView item in insertlist) { OperationEquipmentInsertView insert = new OperationEquipmentInsertView(); insert.EquipmentId = item.EquipmentId; insert.OperationId = idOperation; operationService.insertOperationEquipment(insert); } clearFields(); fillTable(); } } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please complete all fields.')", true); } } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please complete all fields.')", true); } }
private void updateAuxiliar() { if (HttpContext.Current.Session["Operationid"] != null) { OperationService operationService = new OperationService(); List<OperationEquipmentView> insertlist = (List<OperationEquipmentView>)(HttpContext.Current.Session["listUpdateEquipment"]); foreach (OperationEquipmentView item in insertlist) { OperationEquipmentInsertView insert = new OperationEquipmentInsertView(); insert.EquipmentId = item.EquipmentId; insert.OperationId = Int32.Parse(HttpContext.Current.Session["Operationid"].ToString()); operationService.insertOperationEquipment(insert); } clearFields(); fillTable(); } }
private void fillProducts() { OperationService operationService = new OperationService(); List<ProductsView> products = operationService.getProducts(); ProductText.DataSource = products; ProductText.DataBind(); ListItem l = new ListItem("", "", true); l.Selected = true; ProductText.Items.Insert(0, l); }
private void fillTable() { OperationService equipmentService = new OperationService(); List<OperationView> equipmentData = equipmentService.getOperation(); GridView3.DataSource = equipmentData; GridView3.PageIndex = 0; GridView3.DataBind(); }
private void fillProcess(int ProductSelected) { OperationService operationService = new OperationService(); List<RecipeProcessView> products = operationService.getProcessForProduct(ProductSelected); ProcessText.DataSource = products; ProcessText.DataBind(); ListItem l = new ListItem("", "", true); l.Selected = true; ProcessText.Items.Insert(0, l); }
private void fillOperationType(int ProcessSelected) { OperationService operationService = new OperationService(); List<OperationTypeView> types = operationService.getOperationTypeByProcess(ProcessSelected); OperationTypeText.DataSource = types; OperationTypeText.DataBind(); ListItem l = new ListItem("", "", true); l.Selected = true; OperationTypeText.Items.Insert(0, l); }
private void fillEquipmentGroupTable() { OperationService operationService = new OperationService(); List<EquipmentView> equipmentData = operationService.getEquipmentList(); GridView2.DataSource = equipmentData; GridView2.DataBind(); }
protected void searchButton_Click(object sender, ImageClickEventArgs e) { OperationService operationService = new OperationService(); List<OperationView> operationData = operationService.searchOperation(searchText.Text); GridView3.DataSource = operationData; GridView3.DataBind(); }
protected void GridView3_SelectedIndexChanged(object sender, EventArgs e) { clearFields(); //Complete the textbox with the information of the selected row string ProductName = (GridView3.SelectedRow.FindControl("Product") as Label).Text; string ProductNameId = (GridView3.SelectedRow.FindControl("ProductId") as Label).Text; ProductText.Items.Clear(); ListItem l1 = new ListItem(ProductName, ProductNameId, true); l1.Selected = true; ProductText.Items.Insert(0, l1); string ProcessName = (GridView3.SelectedRow.FindControl("Process") as Label).Text; string ProcessNameId = (GridView3.SelectedRow.FindControl("ProcessId") as Label).Text; ProcessText.Items.Clear(); ListItem l2 = new ListItem(ProcessName, ProcessNameId, true); l2.Selected = true; ProcessText.Items.Insert(0, l2); string OperationTypeName = (GridView3.SelectedRow.FindControl("OperationType") as Label).Text; string OperationTypeId = (GridView3.SelectedRow.FindControl("OperationTypeId") as Label).Text; OperationTypeText.Items.Clear(); ListItem l3 = new ListItem(OperationTypeName, OperationTypeId, true); l3.Selected = true; OperationTypeText.Items.Insert(0, l3); string Operation = (GridView3.SelectedRow.FindControl("Operation") as Label).Text; OperationText.Text = Operation; string OperationId = (GridView3.SelectedRow.FindControl("Operationid") as Label).Text; string value = GridView3.SelectedPersistedDataKey.Value.ToString(); HttpContext.Current.Session["Operationid"] = value; foreach (GridViewRow row in GridView3.Rows) { if (row.RowIndex == GridView3.SelectedIndex) { row.BackColor = ColorTranslator.FromHtml("#A1DCF2"); row.ToolTip = string.Empty; } else { row.BackColor = ColorTranslator.FromHtml("#FFFFFF"); row.ToolTip = "Click to select this Row"; } } OperationService operationService = new OperationService(); List<OperationEquipmentView> list = operationService.getEquipmentByOperation(Int32.Parse(OperationId)); GridView1.DataSource = list; GridView1.DataBind(); HttpContext.Current.Session["listEquipment"] = list; }