/// <summary> /// Customizes the work order grid. /// </summary> /// <param name="isopenValue">The isopen.</param> private void CustomizeWorkOrderGridItems(int isopenValue) { this.gdocWorkOrderEngineData = this.form8901Control.WorkItem.F8901_GetWorkOrderEngine(this.systemId, isopenValue); this.workOrderGridCount = this.gdocWorkOrderEngineData.GetWorkOrderEngine.Rows.Count; if (this.workOrderGridCount > 0) { this.WorkOrderGridView.Columns[this.gdocWorkOrderEngineData.GetWorkOrderEngine.WOTypeIDColumn.ColumnName].DataPropertyName = this.gdocWorkOrderEngineData.GetWorkOrderEngine.WOTypeIDColumn.ColumnName; this.WorkOrderGridView.Columns[this.gdocWorkOrderEngineData.GetWorkOrderEngine.WOTypeColumn.ColumnName].DataPropertyName = this.gdocWorkOrderEngineData.GetWorkOrderEngine.WOTypeColumn.ColumnName; this.WorkOrderGridView.Columns[this.gdocWorkOrderEngineData.GetWorkOrderEngine.WODateColumn.ColumnName].DataPropertyName = this.gdocWorkOrderEngineData.GetWorkOrderEngine.WODateColumn.ColumnName; this.WorkOrderGridView.Columns[this.gdocWorkOrderEngineData.GetWorkOrderEngine.CommentsColumn.ColumnName].DataPropertyName = this.gdocWorkOrderEngineData.GetWorkOrderEngine.CommentsColumn.ColumnName; this.WorkOrderGridView.Columns[this.gdocWorkOrderEngineData.GetWorkOrderEngine.IsOpenColumn.ColumnName].DataPropertyName = this.gdocWorkOrderEngineData.GetWorkOrderEngine.IsOpenColumn.ColumnName; this.WorkOrderGridView.Columns[this.gdocWorkOrderEngineData.GetWorkOrderEngine.WOIDColumn.ColumnName].DataPropertyName = this.gdocWorkOrderEngineData.GetWorkOrderEngine.WOIDColumn.ColumnName; //// Primary key column has been set for resolve sorting issue this.WorkOrderGridView.PrimaryKeyColumnName = this.gdocWorkOrderEngineData.GetWorkOrderEngine.WOIDColumn.ColumnName; this.WorkOrderGridView.Enabled = true; this.WorkOrderGridView.AutoGenerateColumns = false; this.WorkOrderGridView.DataSource = this.gdocWorkOrderEngineData.GetWorkOrderEngine.DefaultView; this.WorkOrderGridView.Rows[0].Selected = true; this.DisableVScrollBar(); } else { this.ClearWorkOrderGridItems(); } }
/// <summary> /// Gets the type of the work order. /// </summary> /// <param name="systemId">The system id.</param> /// <returns>Typed Dataset containing the Work Order Type Values</returns> public static GDocWorkOrderEngineData F8901_GetWorkOrderType(int systemId) { GDocWorkOrderEngineData gdocWorkOrderEngineData = new GDocWorkOrderEngineData(); Hashtable ht = new Hashtable(); ht.Add("@SystemID", systemId); Utility.LoadDataSet(gdocWorkOrderEngineData.GetWorkOrderType, "f8901_pclst_WorkOrderType", ht); return(gdocWorkOrderEngineData); }
/// <summary> /// Saves the work order engine. /// </summary> /// <param name="workOrderItems">The work order items.</param> /// <param name="usetId">The user Id</param> /// <returns>Typed Dataset containing the Work Order Engine Values</returns> public static GDocWorkOrderEngineData F8901_SaveWorkOrderEngine(string workOrderItems, int usetId) { GDocWorkOrderEngineData gdocWorkOrderEngineData = new GDocWorkOrderEngineData(); Hashtable ht = new Hashtable(); ht.Add("@WorkOrderItems", workOrderItems); ht.Add("@UserID", usetId); Utility.LoadDataSet(gdocWorkOrderEngineData.SaveWorkOrderEngine, "f8901_pcins_WorkOrderEngine", ht); return(gdocWorkOrderEngineData); // Utility.ExecuteSP("f8030_pcupd_EventEngineSliceHeader", ht); }
/// <summary> /// Loads the work order engine. /// </summary> private void LoadWorkOrderEngine() { int workOrderCount = 0; this.gdocWorkOrderEngineData = this.form8901Control.WorkItem.F8901_GetWorkOrderEngine(this.systemId, (int)ClosedFlagValue.all); workOrderCount = this.gdocWorkOrderEngineData.GetWorkOrderEngine.Rows.Count; ////to check whether workOrderCount have values if (workOrderCount > 0) { if (!string.IsNullOrEmpty(this.gdocWorkOrderEngineData.GetWorkOrderEngine.Rows[0][this.gdocWorkOrderEngineData.GetWorkOrderEngine.SystemColorColumn].ToString())) { this.WorkOrderEngineHeaderColorLabel.BringToFront(); this.WorkOrderEngineHeaderColorLabel.BackColor = (System.Drawing.Color) this.colorConv.ConvertFromInvariantString(this.gdocWorkOrderEngineData.GetWorkOrderEngine.Rows[0][this.gdocWorkOrderEngineData.GetWorkOrderEngine.SystemColorColumn].ToString()); } this.WorkEngineHeaderDescLable.Text = this.gdocWorkOrderEngineData.GetWorkOrderEngine.Rows[0][this.gdocWorkOrderEngineData.GetWorkOrderEngine.SystemNameColumn].ToString(); this.WorkOrderButtons(true); this.DefaultButtonProperties(); this.WorkorderHeaderLock(true); this.WorkOrderEngineAdd.Enabled = true; this.InitWorkOrderTypeCombo(); this.WorkOrderEngineDateTextBox.Text = DateTime.Now.ToString(this.dateFormat); this.dateChanged = true; this.WorkOrderMonthCalander.Visible = false; this.WorkOrderEngineDateImage.Enabled = true; this.CustomizeWorkOrderGridItems((int)ClosedFlagValue.all); ////when new permission is not avaliable then disable the WorkorderHeader. if (!this.PermissionFiled.newPermission) { this.WorkOrderEngineAdd.Enabled = false; this.WorkorderHeaderLock(false); } else { this.WorkOrderEngineAdd.Enabled = true; this.WorkorderHeaderLock(true); } } else { this.DisableWorkorderHeader(); } }
/// <summary> /// Load the workordertype combo. /// </summary> private void InitWorkOrderTypeCombo() { GDocWorkOrderEngineData.GetWorkOrderTypeDataTable workOrderType = new GDocWorkOrderEngineData.GetWorkOrderTypeDataTable(); ////temporary row is created and added to a temporary datatable(workOrderType) DataRow customRow = workOrderType.NewRow(); workOrderType.Clear(); ////<Select> is addded customRow[this.gdocWorkOrderEngineData.GetWorkOrderType.WOTypeIDColumn.ColumnName] = "0"; customRow[this.gdocWorkOrderEngineData.GetWorkOrderType.WOTypeColumn.ColumnName] = "<Select>"; workOrderType.Rows.Add(customRow); this.gdocWorkOrderEngineData = this.form8901Control.WorkItem.F8901_GetWorkOrderType(this.systemId); ////The original datatable and temp datatable is merged workOrderType.Merge(this.gdocWorkOrderEngineData.GetWorkOrderType); this.WorkOrderTypeComboBox.ValueMember = this.gdocWorkOrderEngineData.GetWorkOrderType.WOTypeIDColumn.ColumnName; this.WorkOrderTypeComboBox.DisplayMember = this.gdocWorkOrderEngineData.GetWorkOrderType.WOTypeColumn.ColumnName; this.WorkOrderTypeComboBox.DataSource = workOrderType; this.WorkOrderTypeComboBox.SelectedIndex = 0; }