Exemplo n.º 1
0
        private void InitializeDropDownValues(int itemId)
        {
            DataTable dt = new DataTable();

            dt = ButtonsUtility.InitializeItemDropDownMaterials(itemId);
            comboBoxMaterials.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxMaterials.Items.Add(dt.Rows[i][0]);
            }
        }
Exemplo n.º 2
0
        private void GetObervationActivities()
        {
            DataSet ds = new DataSet("TimeRanges");

            ds = ButtonsUtility.GetActivitesObservationOEE(Item_Id);
            dataGridViewObsOEEKPI.DataSource = ds.Tables[0];
            dataGridViewObsOEEKPI.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

            dataGridViewAcitvityOEEKPI.DataSource = ds.Tables[1];
            dataGridViewAcitvityOEEKPI.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }
        private void GetPreviousEntriesDownTime(string dateTime)
        {
            int downTime = ButtonsUtility.GetDownTime(dateTime, MachineId, WorkShopId, ItemId, ProcessId);

            if (downTime > 0)
            {
                textBoxDownTimeDailyEntry.Text = downTime.ToString();
                decimal ratio        = (downTime / Convert.ToDecimal(textBoxShitTimeMachinedailyEntryMachine.Text)) * 100;
                decimal ratioRounded = (Math.Round(ratio, 2));
                textBoxRatioDailyTimeEntry.Text = ratioRounded.ToString();
            }
        }
Exemplo n.º 4
0
        private void dataGridViewMachineDetails_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string MachineCode = dataGridViewMachineDetails.CurrentRow.Cells[0].Value.ToString();
            int    rows        = ButtonsUtility.RemoveMachineAssociationWithItem(MachineCode, Item_Id);

            if (rows > 0)
            {
                labelMachineinfoUpdateSucessful.Visible = true;

                GetGridData();
            }
        }
        private void GetProcess()
        {
            DataTable dt = new DataTable();

            dt = ButtonsUtility.GetProcesses(Item_Id);

            comboBoxSelectProcess.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxSelectProcess.Items.Add(dt.Rows[i][0]);
            }
        }
        private void buttonSaveTarget_Click(object sender, EventArgs e)
        {
            int row = ButtonsUtility.InsertTargetEquipmentFailureWorkShop(WorkShop_Id, Month_Id, Convert.ToDecimal(textBoxTarget.Text), Convert.ToInt32(textBoxNoOfDays.Text), dateTimePickerEquipFailRate.Value.Year);

            if (row > 0)
            {
                labelTargetSaved.Visible = true;
                buttonEdit.Visible       = true;
                buttonSaveTarget.Visible = false;
                GetGridCalculations();
                this.Refresh();
            }
        }
        private void GetProcess()
        {
            comboBoxProcess.Items.Clear();
            DataTable dt = new DataTable();

            dt = ButtonsUtility.GetProcessesForMachine(ItemId, MachineId);


            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxProcess.Items.Add(dt.Rows[i][0]);
            }
        }
        private void TextBoxesCalculatedValuesofItemSelectedbyCombo(string itemName)
        {
            Item_Id = ButtonsUtility.GetITemId(itemName);

            if (comboBoxDie.Visible == true)
            {
                InitializeComboBoxDie(Item_Id);
            }


            labelRecordupdatedSucessfully.Visible = false;
            labelPleaseSelectItem.Visible         = false;
        }
        private void textBoxTotalUnits_TextChanged(object sender, EventArgs e)
        {
            if (textBoxCostofEachUnit.Text != "" && textBoxTotalMaterial.Text != "")
            {
                //decimal costofEachUnitOfMultiple = Convert.ToDecimal(textBoxCostofEachUnit.Text) / Convert.ToDecimal(textBoxMultiple.Text);

                //textBoxTotalCost.Text = (costofEachUnitOfMultiple * Convert.ToDecimal(textBoxTotalMaterial.Text)).ToString();
                decimal costofEachUnitOfMultiple = ButtonsUtility.CalculateTotalCostofMaterial(Convert.ToDecimal(textBoxCostofEachUnit.Text), Convert.ToDecimal(textBoxMultiple.Text), Convert.ToDecimal(textBoxTotalMaterial.Text));
                textBoxTotalCost.Text = (costofEachUnitOfMultiple).ToString();
            }
            labelPleaseEnterTotalMaterialUsed.Visible       = false;
            labelRecordupdatedSucessfullyDailyEntry.Visible = false;
        }
        private void buttonSaveTarget_Click(object sender, EventArgs e)
        {
            int row = ButtonsUtility.InsertTargetCustRejcectionkCost(Item_Id, Month_Id, Convert.ToDecimal(textBoxTarget.Text), dateTimePickerCostCustRej.Value.Year);

            if (row > 0)
            {
                labelTargetSaved.Visible = true;
                buttonEdit.Visible       = true;
                buttonSaveTarget.Visible = false;
                GetGridCalculations();
                this.Refresh();
            }
        }
        private void GetWorkShops()
        {
            DataTable dt = new DataTable();

            dt = ButtonsUtility.ViewShops();


            comboBoxWorkShopMachine.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxWorkShopMachine.Items.Add(dt.Rows[i][0]);
            }
        }
        private void comboBoxProcess_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();

            dt        = ButtonsUtility.GetProcessIdAndCapacity(comboBoxProcess.Text, ItemId);
            ProcessId = Convert.ToInt32(dt.Rows[0][0]);

            textBoxDownTimeDailyEntry.Text = "";

            labelPleaseSelectProcess.Visible = false;

            GetPreviousEntriesDownTime(dateTimePickerDailyEntryMachine.Text);
            labelPleasePresseditButtonforalreadyseavedentry.Visible = false;
        }
 private void comboBoxWorkShop_SelectedIndexChanged(object sender, EventArgs e)
 {
     labelPleaseCreateAMachine.Visible = false;
     labelSelectWSFirstMachinedailyEntryMachine.Visible = false;
     textBoxDownTimeDailyEntry.Text  = "";
     textBoxRatioDailyTimeEntry.Text = "";
     labelPleasePresseditButtonforalreadyseavedentry.Visible = false;
     WorkShopId = ButtonsUtility.GetWorkShopId(comboBoxWorkShopMachinedailyEntryMachine.Text);
     labelMachineinfoUpdateSucessful.Visible        = false;
     labelMachineInfoInsertSucess.Visible           = false;
     comboBoxMachineSelectiondailyEntryMachine.Text = "";
     GetMachines();
     labelPleasePresseditButtonforalreadyseavedentry.Visible = false;
 }
Exemplo n.º 14
0
 private void Delete()
 {
     if (textBoxID.Text != "")
     {
         int rows = ButtonsUtility.RemoveEmployee(empId);
         if (rows > 0)
         {
             textBoxID.Clear();
             textBoxName.Clear();
             textBoxStatus.Clear();
             labelDelete.Visible = true;
         }
     }
 }
Exemplo n.º 15
0
        private void GetDetails(string id)
        {
            DataTable dt = ButtonsUtility.GetEmpDetails(id);

            if (dt.Rows[0][0].ToString() != "0")
            {
                textBoxName.Text          = dt.Rows[0][0].ToString();
                textBoxID.Text            = dt.Rows[0][1].ToString();
                textBoxContactNumber.Text = dt.Rows[0][2].ToString();
                textBoxAddress.Text       = dt.Rows[0][3].ToString();
                textBoxEmail.Text         = dt.Rows[0][4].ToString();
                empId = dt.Rows[0][1].ToString();
            }
        }
Exemplo n.º 16
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            int rows = ButtonsUtility.DeleteWorkShop(WorkShopId);

            if (rows > 0)
            {
                textBoxWorkShopName.Clear();

                comboBoxWorkShop.Text = "";

                labelDelete.Visible = true;
                GetWorkShop();
            }
        }
        private void buttonSaveTarget_Click(object sender, EventArgs e)
        {
            int row = ButtonsUtility.InsertTargetDelivaryComplianceRatio(Item_Id, Month_Id, Convert.ToDecimal(textBoxTarget.Text), dateTimePickerDelComp.Value.Year);

            if (row > 0)
            {
                labelTargetSaved.Visible = true;
                buttonEdit.Visible       = true;
                buttonSaveTarget.Visible = false;
                GetGridCalculations();
                //  this.Refresh();
                labelMonthlyDelivaryComplianceKPI.Select();
            }
        }
        private void InitializeDropDownWorkShop()
        {
            DataTable dt = new DataTable();

            dt = ButtonsUtility.ViewShops();



            comboBoxShop.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxShop.Items.Add(dt.Rows[i][0]);
            }
        }
        private void GetMaterialDetails(string Code)
        {
            DataTable dt      = new DataTable();
            DataTable dtdaily = new DataTable();

            dt = ButtonsUtility.GetMaterials(Material_Code, Item_Id);

            dtdaily = ButtonsUtility.GetMaterialsDaily(Material_Code, Item_Id, dateTimePickerMaterial.Text);


            if (dt.Rows.Count > 0)
            {
                textBoxUnit.Text           = dt.Rows[0][2].ToString(); //unit
                textBoxMultiple.Text       = dt.Rows[0][3].ToString(); //Multiple
                textBoxCostofEachUnit.Text = dt.Rows[0][4].ToString(); //costofEach
                decimal Multiples = Convert.ToDecimal(dt.Rows[0][3]);

                if (!string.IsNullOrEmpty(textBoxDailyProduction.Text))
                {
                    //textBoxPlannedMaterialUsed
                    textBoxPlannedMaterialUsed.Text = (Multiples * Convert.ToInt32(textBoxDailyProduction.Text)).ToString();
                    //Planned cost
                    textBoxPlannedCost.Text = ((Convert.ToInt32(textBoxDailyProduction.Text)) * (Convert.ToDecimal(dt.Rows[0][4]))).ToString();
                }
                if (textBoxTotalMaterial.Text != "")
                {
                    decimal costofEachUnitOfMultiple = Convert.ToDecimal(dt.Rows[0][4]) / Multiples;

                    textBoxTotalCost.Text = (costofEachUnitOfMultiple * Convert.ToDecimal(textBoxTotalMaterial.Text)).ToString();
                }
                Material_Id = Convert.ToInt32(dt.Rows[0][5]);
            }
            if (dtdaily.Rows.Count > 0)
            {
                textBoxTotalMaterial.Text          = dtdaily.Rows[0][0].ToString();
                textBoxTotalCost.Text              = dtdaily.Rows[0][1].ToString();
                labelPleaseEnterdailyEntry.Visible = false;
                buttonDailyEntry.Visible           = false;
                buttonEdit.Visible = true;
            }
            else
            {
                textBoxTotalMaterial.Text = "";
                textBoxTotalCost.Text     = "";
                labelPleaseEnterTotalMaterialUsed.Visible = true;
                //labelPleaseEnterdailyEntry.Visible = true;
                //buttonDailyEntry.Visible = true;
            }
        }
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     if (dataGridViewWorkerDetails.SelectedRows.Count == 1)
     {
         int rowsAffected = ButtonsUtility.DeleteWorker(workerId);
         if (rowsAffected > 0)
         {
             MessageBox.Show("Worker deleted Successfully.", "Success");
         }
     }
     else
     {
         MessageBox.Show("Please Select a single row to Edit.", "Warning");
     }
 }
        private void buttonBackCostOfRejectionKPI_Click(object sender, EventArgs e)
        {
            //if (Back == 0)
            //{
            //    OverAll_KPIs KPI = new OverAll_KPIs(0);
            //    KPI.Show();
            //    this.Close();

            //}
            //else
            //{
            ButtonsUtility.Menu(Item_Id);
            this.Close();
            //}
        }
Exemplo n.º 22
0
 private void dateTimePicker_ValueChanged(object sender, EventArgs e)
 {
     if ((textBoxName.Text != "" || textBoxName.Text != "No Record Found") && textBoxID.Text != "")
     {
         string Attendance = ButtonsUtility.GetEmployeeAttendance(textBoxID.Text, dateTimePicker.Text);
         textBoxStatus.Text     = Attendance;
         buttonArrival.Visible  = true;
         buttonEditInfo.Visible = true;
         textBoxID.Clear();
         textBoxName.Clear();
         textBoxStatus.Clear();
         //   buttonStatus.Visible = true;
         //  buttonAbsent.Visible = true;
     }
 }
        private void FetchUserDetails(int User_Id)
        {
            DataTable dt = new DataTable();

            dt = ButtonsUtility.FetchUserDetails(User_Id);
            if (dt.Rows.Count > 0)
            {
                textBoxUserName.Text      = dt.Rows[0][0].ToString();
                textBoxPassword.Text      = dt.Rows[0][1].ToString();
                comboBoxUserType.Text     = dt.Rows[0][2].ToString();
                textBoxContactNumber.Text = dt.Rows[0][3].ToString();
                textBoxEmail.Text         = dt.Rows[0][4].ToString();
                textBoxAddress.Text       = dt.Rows[0][5].ToString();
            }
        }
        private void TextBoxesCalculatedValues(int itemId)
        {
            DataTable dt = new DataTable();

            dt = ButtonsUtility.TotalUnitsMadeDetails(itemId);
            if (dt.Rows.Count == 0)
            {
            }
            else
            {
                textBoxTotalUnitsReworkRatio.Text     = dt.Rows[0][1].ToString();
                textBoxCostofEachUnitReworkRatio.Text = dt.Rows[0][2].ToString();
                //   textBoxTotalCostReworkRatio.Text = dt.Rows[0][3].ToString();
            }
        }
Exemplo n.º 25
0
        private void FetchItemDetails(int ItemId)
        {
            DataTable dt = new DataTable();

            dt = ButtonsUtility.FetchItemDetails(ItemId);

            textBoxNameOfItem.Text     = dt.Rows[0][0].ToString();
            textBoxtemDescription.Text = dt.Rows[0][1].ToString();
            textBoxItemCode.Text       = dt.Rows[0][2].ToString();
            labelItemCode.Text         = dt.Rows[0][2].ToString();
            textBoxUOM.Text            = dt.Rows[0][3].ToString();
            textBoxCostofEachUnit.Text = dt.Rows[0][4].ToString();
            textBoxRework.Text         = dt.Rows[0][5].ToString();
            textBoxInhouseRej.Text     = dt.Rows[0][6].ToString();
        }
Exemplo n.º 26
0
        private void GetMaterialDetails(string Code)
        {
            DataTable dt = new DataTable();

            dt = ButtonsUtility.GetMaterials(Material_Code, Item_Id);

            textBoxName.Text     = dt.Rows[0][0].ToString();
            textBoxCode.Text     = dt.Rows[0][1].ToString();
            textBoxUnit.Text     = dt.Rows[0][2].ToString();
            textBoxMultiple.Text = dt.Rows[0][3].ToString();
            textBoxCost.Text     = dt.Rows[0][4].ToString();


            Material_Id = Convert.ToInt32(dt.Rows[0][5]);
        }
 public DailyEntry_CustomerClaims(int itemId)
 {
     InitializeComponent();
     Item_Id = itemId;
     if (itemId > 0)
     {
         string ItemName = ButtonsUtility.ItemNameUtility(itemId);
         labelItemNameCustomerClaims.Text = ItemName;
         comboBoxItemsDailyEntryDelivaryCompliance.Visible = false;
         labelSelectItemDailyEntryCustomerClaims.Visible   = false;
     }
     else if (Item_Id == 0)
     {
         InitializeDropDownItemValues();
     }
 }
        private void GetMoldData(int moldId)
        {
            DataTable dt = new DataTable();

            dt = ButtonsUtility.GetDieAndMoldDataToEdit(moldId);
            if (dt.Rows.Count > 0)
            {
                textBoxName.Text             = dt.Rows[0][0].ToString();
                textBoxCode.Text             = dt.Rows[0][1].ToString();
                textBoxPlannedShots.Text     = dt.Rows[0][2].ToString();
                comboBoxItems.Text           = dt.Rows[0][3].ToString();
                buttonDailyEntrySave.Visible = false;
            }

            Mold_Code = textBoxCode.Text;
        }
        private void InitializeDropDownItemValues()
        {
            DataTable dt = new DataTable();

            dt = ButtonsUtility.InitializeItemByMachineDropDown(MachineId);
            if (dt.Rows.Count < 1)
            {
                labelAssociateMachineWithItem.Visible = true;
                comboBoxItem.Text = "";
            }
            comboBoxItem.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxItem.Items.Add(dt.Rows[i][0]);
            }
        }
        private void btnExport_Click(object sender, EventArgs e)
        {
            string    Path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            DataTable dt   = new DataTable();

            if (dateTimePickerFrom.Value < dateTimePickerTo.Value)
            {
                dt = ButtonsUtility.GetEmployeeAttendanceDetails(textBoxID.Text, dateTimePickerFrom.Text, dateTimePickerTo.Text);
                labelReportisGenerating.Visible = true;
                Reports.ExportDataSetToExcel(dt, Path, dt.Rows[0][0].ToString());
                labelReportisGenerating.Visible = false;
            }
            else
            {
                DialogResult dialog = MessageBox.Show("From Date is always less then To Date. ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }