public void bindData() { GeneralLookup AllDesigners = new GeneralLookup(); AllDesigners.Where.CategoryID.Value = 1; AllDesigners.Where.CategoryID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal; AllDesigners.Query.Load(); GridViewDesigners.DataSource = AllDesigners.DefaultView; GridViewDesigners.DataBind(); }
public void GetJODesigners() { GeneralLookup Designers = new GeneralLookup(); Designers.LoadByCategoryID(Category.Designers); List<Models.Designer> AllDesigers = Designers.DefaultView.Table.AsEnumerable().Select(row => { return new Models.Designer { DesignerID = Convert.ToInt32(row[GeneralLookup.ColumnNames.GeneralLookupID].ToString()), CategoryID = Convert.ToInt32(row[GeneralLookup.ColumnNames.CategoryID].ToString()), DesignerName = row[GeneralLookup.ColumnNames.Name].ToString(), Address = row[GeneralLookup.ColumnNames.Address].ToString(), Email = row[GeneralLookup.ColumnNames.Email].ToString(), Telephone = row[GeneralLookup.ColumnNames.Telephone].ToString(), }; }).ToList(); SetContentResult(AllDesigers); //return _response; }
protected void btnSave_Click(object sender, EventArgs e) { GeneralLookup designer = new GeneralLookup(); if (EditDesigner > 0) { designer.LoadByPrimaryKey(EditDesigner); } else { designer.AddNew(); } designer.Name = txtDesignerName.Text; designer.Address = txtDesignerAddress.Text; designer.Email = txtDesignerEmail.Text; designer.Telephone = txtDesignerTelephone.Text; designer.CategoryID = 1; designer.Save(); ClearFields(); bindData(); panelDesignersGrid.Visible = true; panelDesignersEdit.Visible = false; }
private void LoadData() { Clients clients = new Clients(); clients.LoadAll(); uiDropDownListClient.DataSource = clients.DefaultView; uiDropDownListClient.DataTextField = Clients.ColumnNames.ClientName; uiDropDownListClient.DataValueField = Clients.ColumnNames.ClientID; uiDropDownListClient.DataBind(); JobOrderStatus statuses = new JobOrderStatus(); statuses.LoadAll(); uiDropDownListJOStatus.DataSource = statuses.DefaultView; uiDropDownListJOStatus.DataTextField = JobOrderStatus.ColumnNames.JobOrderStatusNameAr; uiDropDownListJOStatus.DataValueField = JobOrderStatus.ColumnNames.JobOrderStatusID; uiDropDownListJOStatus.DataBind(); GeneralLookup digitalItem = new GeneralLookup (); digitalItem.LoadByCategoryID(Category.DigitalPrintingType); uiCheckBoxListDigitalItem.DataSource = digitalItem.DefaultView; uiCheckBoxListDigitalItem.DataTextField = GeneralLookup.ColumnNames.Name; uiCheckBoxListDigitalItem.DataValueField = GeneralLookup.ColumnNames.GeneralLookupID; uiCheckBoxListDigitalItem.DataBind(); GeneralLookup serviceType = new GeneralLookup(); serviceType.LoadByCategoryID(Category.DigitalPrintingServiceType); uiCheckBoxListServiceType.DataSource = serviceType.DefaultView; uiCheckBoxListServiceType.DataTextField = GeneralLookup.ColumnNames.Name; uiCheckBoxListServiceType.DataValueField = GeneralLookup.ColumnNames.GeneralLookupID; uiCheckBoxListServiceType.DataBind(); GeneralLookup digitalPrintingSupplier = new GeneralLookup(); digitalPrintingSupplier.LoadByCategoryID(Category.DigitalPrintingSupplier); uiDropDownListDigitalPrintingSupplier.DataSource = digitalPrintingSupplier.DefaultView; uiDropDownListDigitalPrintingSupplier.DataTextField = GeneralLookup.ColumnNames.Name; uiDropDownListDigitalPrintingSupplier.DataValueField = GeneralLookup.ColumnNames.GeneralLookupID; uiDropDownListDigitalPrintingSupplier.DataBind(); GeneralLookup paperType = new GeneralLookup(); paperType.LoadByCategoryID(Category.OffsetPrintingPaperType); uiRadioButtonListPaperType.DataSource = paperType.DefaultView; uiRadioButtonListPaperType.DataTextField = GeneralLookup.ColumnNames.Name; uiRadioButtonListPaperType.DataValueField = GeneralLookup.ColumnNames.GeneralLookupID; uiRadioButtonListPaperType.DataBind(); GeneralLookup GSM = new GeneralLookup(); GSM.LoadByCategoryID(Category.OffsetPrintingGSM); uiRadioButtonListGSM.DataSource = GSM.DefaultView; uiRadioButtonListGSM.DataTextField = GeneralLookup.ColumnNames.Name; uiRadioButtonListGSM.DataValueField = GeneralLookup.ColumnNames.GeneralLookupID; uiRadioButtonListGSM.DataBind(); GeneralLookup offsetPrintHouse = new GeneralLookup(); offsetPrintHouse.LoadByCategoryID(Category.OffsetPrintingPrintHouse); uiDropDownListOffsetPrintHouse.DataSource = offsetPrintHouse.DefaultView; uiDropDownListOffsetPrintHouse.DataTextField = GeneralLookup.ColumnNames.Name; uiDropDownListOffsetPrintHouse.DataValueField = GeneralLookup.ColumnNames.GeneralLookupID; uiDropDownListOffsetPrintHouse.DataBind(); GeneralLookup finishBy = new GeneralLookup(); finishBy.LoadByCategoryID(Category.OffsetPrintingFinishingSupplier); uiDropDownListOffsetPrintingFinishingBy.DataSource = finishBy.DefaultView; uiDropDownListOffsetPrintingFinishingBy.DataTextField = GeneralLookup.ColumnNames.Name; uiDropDownListOffsetPrintingFinishingBy.DataValueField = GeneralLookup.ColumnNames.GeneralLookupID; uiDropDownListOffsetPrintingFinishingBy.DataBind(); GeneralLookup offsetFinishType = new GeneralLookup(); offsetFinishType.LoadByCategoryID(Category.OffsetPrintingFinishType); uiCheckBoxListOffsetFinishType.DataSource = offsetFinishType.DefaultView; uiCheckBoxListOffsetFinishType.DataTextField = GeneralLookup.ColumnNames.Name; uiCheckBoxListOffsetFinishType.DataValueField = GeneralLookup.ColumnNames.GeneralLookupID; uiCheckBoxListOffsetFinishType.DataBind(); }
protected void GridViewDesigners_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "editDesigner") { GeneralLookup designer = new GeneralLookup(); designer.LoadByPrimaryKey(int.Parse(e.CommandArgument.ToString())); txtDesignerAddress.Text = designer.Address; txtDesignerEmail.Text = designer.Email; txtDesignerName.Text = designer.Name; txtDesignerTelephone.Text = designer.Telephone; EditDesigner = int.Parse(e.CommandArgument.ToString()); panelDesignersEdit.Visible = true; panelDesignersGrid.Visible = false; } else if (e.CommandName == "deleteDesigner") { GeneralLookup designer = new GeneralLookup(); designer.LoadByPrimaryKey(int.Parse(e.CommandArgument.ToString())); designer.MarkAsDeleted(); designer.Save(); bindData(); } }