Esempio n. 1
0
        /// <summary>
        /// Lists the Materials Resource Type
        /// </summary>
        /// <param name="flagActiveAndAll">The flag active and all.</param>
        /// <param name="eventId">eventId</param>
        /// <returns>
        /// returns dataset contains Materials Resource Type
        /// </returns>
        public static F8044MaterialsData F8044_ListMaterialsResourceType(int flagActiveAndAll, int eventId)
        {
            F8044MaterialsData materialsData = new F8044MaterialsData();
            Hashtable          ht            = new Hashtable();

            ht.Add("@IsActive", flagActiveAndAll);
            ht.Add("@EventID", eventId);
            Utility.LoadDataSet(materialsData.ListMaterialsResource, "f8044_pclst_FS_MaterialsResource", ht);
            return(materialsData);
        }
Esempio n. 2
0
        /// <summary>
        /// Lists the EventEngineTVDetails
        /// </summary>
        /// <param name="formId">The form id.</param>
        /// <param name="keyId">The key id.</param>
        /// <returns>returns dataset contains EventEngine TVDetails</returns>
        public static F8044MaterialsData F8044_ListMaterialDetails(int formId, int keyId)
        {
            F8044MaterialsData materialsData = new F8044MaterialsData();
            Hashtable          ht            = new Hashtable();

            ht.Add("@FormID", formId);
            ht.Add("@KeyID", keyId);
            Utility.LoadDataSet(materialsData.ListMaterials, "f8044_pclst_FS_Materials", ht);
            return(materialsData);
        }
Esempio n. 3
0
        public void OnD9030_F9030_EnableNewMethod(object sender, DataEventArgs <int> eventArgs)
        {
            this.pageMode = TerraScanCommon.PageModeTypes.New;
            this.ClearTimeDetails();
            F8044MaterialsData tempMaterialsDetailsDataSet = new F8044MaterialsData();

            this.MaterialsGridView.DataSource = tempMaterialsDetailsDataSet.ListMaterials;
            if (this.MaterialsGridView.CurrentCell != null)
            {
                this.MaterialsGridView.CurrentCell = null;
            }

            this.DisableControls(false);
        }
Esempio n. 4
0
        /// <summary>
        /// Adds the record.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void AddRecord(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                string validationErrors = string.Empty;

                F8044MaterialsData materialsData       = new F8044MaterialsData();
                F8044MaterialsData.SaveMaterialsRow dr = materialsData.SaveMaterials.NewSaveMaterialsRow();

                dr.KeyID = this.keyId;
                ////dr.WOID = null;
                if (Convert.ToInt32(this.UserComboBox.SelectedValue.ToString()) == 0)
                {
                    validationErrors = validationErrors + SharedFunctions.GetResourceString("F8044SelectUserName"); //// "Please select the User. \n";
                }
                else
                {
                    dr.UserID = Convert.ToInt32(this.UserComboBox.SelectedValue.ToString());
                }

                if (Convert.ToInt32(this.PartComboBox.SelectedValue.ToString()) == 0)
                {
                    validationErrors = validationErrors + SharedFunctions.GetResourceString("F8044SelectPartName"); ////"Please select the Part. \n";
                }
                else
                {
                    dr.PartID = Convert.ToInt32(this.PartComboBox.SelectedValue.ToString());
                }

                if (string.IsNullOrEmpty(this.QntyTextBox.Text.Trim()))
                {
                    validationErrors = validationErrors + SharedFunctions.GetResourceString("F8044CheckQntyEmpty"); ////"Quantity can't be empty. \n";
                }
                else
                {
                    try
                    {
                        int addedQuantity = Convert.ToInt16(this.QntyTextBox.Text.Trim());
                        if ((addedQuantity > 0) && (addedQuantity < 256))
                        {
                            dr.Quantity = addedQuantity;
                        }
                        else
                        {
                            validationErrors = validationErrors + SharedFunctions.GetResourceString("F8044CheckQntyMaxValue"); ////"Please give value between 0 and 255 for Quantity. \n";
                        }
                    }
                    catch
                    {
                        validationErrors = validationErrors + SharedFunctions.GetResourceString("F8044CheckQntyNumeric"); ////"Please give a numeric value for Quantity. \n";
                    }
                }

                dr.Comment = this.CommentTextBox.Text.Trim();

                dr.MasterFormID = this.masterFormNo;

                if (string.IsNullOrEmpty(validationErrors.Trim()))
                {
                    materialsData.SaveMaterials.Rows.Add(dr);
                    DataSet tempDataSet = new DataSet("Root");
                    tempDataSet.Tables.Add(materialsData.SaveMaterials.Copy());
                    tempDataSet.Tables[0].TableName = "Table";

                    this.form8044Control.WorkItem.F8044_SaveMaterialDetails(tempDataSet.GetXml(), TerraScan.Common.TerraScanCommon.UserId);
                    this.ClearTimeDetails();
                    this.UserComboBox.SelectedIndex = 0;
                    this.PartComboBox.SelectedIndex = 0;
                    this.PopulateMaterialDetails();
                    this.FormSlice_MaterialFooterCountRefresh(sender, e);
                }
                else
                {
                    MessageBox.Show(validationErrors, ConfigurationWrapper.ApplicationSave, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (SoapException ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Populates the material details.
        /// </summary>
        private void PopulateMaterialDetails()
        {
            try
            {
                // Issue Fix : Code Starts Here
                int keyIdValid = this.form8044Control.WorkItem.F8044_CheckEventId(this.formNO, this.keyId);

                if (keyIdValid == 1)
                {
                    this.DisableHeaderControls(true);
                    this.DisableControls(true);
                    this.materialDetailsDataSet         = this.form8044Control.WorkItem.F8044_ListMaterialDetails(this.masterFormNo, this.keyId);
                    this.actualMaterialDetailsRowsCount = this.materialDetailsDataSet.ListMaterials.Rows.Count;
                    if (this.materialDetailsDataSet.ListMaterials.Rows.Count > 0)
                    {
                        (this.MaterialsGridView.Columns["User"] as DataGridViewComboBoxColumn).DataSource    = this.gridUserTypeList;
                        (this.MaterialsGridView.Columns["User"] as DataGridViewComboBoxColumn).DisplayMember = this.gridUserTypeList.ResourceNameColumn.ColumnName; ////"ResourceName";
                        (this.MaterialsGridView.Columns["User"] as DataGridViewComboBoxColumn).ValueMember   = this.gridUserTypeList.ResourceIDColumn.ColumnName;   ////"ResourceID";

                        (this.MaterialsGridView.Columns["Part"] as DataGridViewComboBoxColumn).DataSource    = this.gridPartTypeDataTableAll;
                        (this.MaterialsGridView.Columns["Part"] as DataGridViewComboBoxColumn).DisplayMember = this.gridPartTypeDataTableAll.PartDescriptionColumn.ColumnName; ////"PartDescription";
                        (this.MaterialsGridView.Columns["Part"] as DataGridViewComboBoxColumn).ValueMember   = this.gridPartTypeDataTableAll.PartIDColumn.ColumnName;          ////"PartID";

                        this.MaterialsGridView.ReadOnly = false;
                        this.MaterialsGridView.TabStop  = true;
                        ////VscrollBar is enabled or disabled based on NumRowsVisible in GridView
                        if (this.materialDetailsDataSet.ListMaterials.Rows.Count > this.MaterialsGridView.NumRowsVisible)
                        {
                            this.InspectionDetailsGridVscrollBar.Visible = false;
                        }
                        else
                        {
                            this.InspectionDetailsGridVscrollBar.Visible = true;
                        }
                        ////Populates the material details
                        this.MaterialsGridView.DataSource = this.materialDetailsDataSet.ListMaterials;
                    }
                    else
                    {
                        ////Disabled the controls if there are no records
                        this.MaterialsGridView.ReadOnly   = true;
                        this.MaterialsGridView.TabStop    = false;
                        this.MaterialsGridView.DataSource = this.materialDetailsDataSet.ListMaterials;
                    }
                }
                else
                {
                    this.DisableControls(false);
                }

                // Issue Fix : Code Ends Here
            }
            catch (SoapException ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
        }