public void bindData()
 {
     JobOrderStatus status = new JobOrderStatus();
     status.LoadAll();
     GridViewStatus.DataSource = status.DefaultView;
     GridViewStatus.DataBind();
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            JobOrderStatus status = new JobOrderStatus();

            if (EditJobOrderStatus > 0)
            {
                status.LoadByPrimaryKey(EditJobOrderStatus);
            }
            else
            {
                status.AddNew();
            }
            status.JobOrderStatusName = txtStatusName.Text;
            status.JobOrderStatusNameAr = txtStatusNameAr.Text;
            status.StatusClass = dropDownStatusColor.Value;
            status.Save();

            ClearFields();
            bindData();
            panelStatusGrid.Visible = true;
            panelStatusEdit.Visible = false;
        }
 protected void GridViewStatus_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "editStatus")
     {
         JobOrderStatus status = new JobOrderStatus();
         status.LoadByPrimaryKey(int.Parse(e.CommandArgument.ToString()));
         txtStatusName.Text = status.JobOrderStatusName;
         txtStatusNameAr.Text = status.JobOrderStatusNameAr;
         dropDownStatusColor.Value = status.StatusClass;
         EditJobOrderStatus = int.Parse(e.CommandArgument.ToString());
         panelStatusGrid.Visible = false;
         panelStatusEdit.Visible = true;
     }
     else if (e.CommandName == "deleteStatus")
     {
         JobOrderStatus status = new JobOrderStatus();
         status.LoadByPrimaryKey(int.Parse(e.CommandArgument.ToString()));
         status.MarkAsDeleted();
         status.Save();
         bindData();
     }
 }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        public void GetJOStatuses()
        {
            JobOrderStatus statues = new JobOrderStatus();
            statues.LoadAll();

            List<Models.StatusModel> AllStatuses = statues.DefaultView.Table.AsEnumerable().Select(row =>
            {
                return new Models.StatusModel
                {
                    StatusID = Convert.ToInt32(row[JobOrderStatus.ColumnNames.JobOrderStatusID].ToString()),
                    StatusName = row[JobOrderStatus.ColumnNames.JobOrderStatusName].ToString(),
                    StatusNameAr = row[JobOrderStatus.ColumnNames.JobOrderStatusNameAr].ToString(),
                    StatusClass = row[JobOrderStatus.ColumnNames.StatusClass].ToString()
                };
            }).ToList();

            SetContentResult(AllStatuses);
            //return _response;
        }