private void btmSearchItems_Click(object sender, EventArgs e)
        {
            try
            {
                this.dsShifts.Clear();
            }
            catch (System.NullReferenceException)
            { }

            this.mfiSearch.strEquipTagPty = this.tbTag.Text;
            this.mfiSearch.strTipPty      = this.tbTip.Text;

            this.dsItems = MaintenanceFurnaceItem.GetMFIs(this.cnConnection, this.mfiSearch, this.tbStoreCode.Text.Trim(), this.tbPersonCoID.Text.Trim());

            this.dgvItems.DataSource = this.dsItems;
            this.dgvItems.DataMember = "tabMaintenanceFurnaceItems";
        }
        private void dgvShifts_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == -1 && e.RowIndex != -1)
            {
                int intIDLoc = (int)this.dgvShifts.Rows[e.RowIndex].Cells["intID"].Value;
                this.mfiSearch          = new MaintenanceFurnaceItem();
                this.mfiSearch.intIDPty = intIDLoc;
                this.dsItems            = MaintenanceFurnaceItem.GetMFIs(this.cnConnection, this.mfiSearch, this.tbStoreCode.Text.Trim(), this.tbPersonCoID.Text.Trim());

                this.dgvItems.DataSource = this.dsItems;
                this.dgvItems.DataMember = "tabMaintenanceFurnaceItems";

                foreach (DataRow drEmployee in this.dsItems.Tables["tabMaintenanceFurnaceItems"].Rows)
                {
                    drEmployee["nvcPersonCoID"] = Employee.GetNameByCoID(this.cnConnection, drEmployee["nvcPersonCoID"].ToString());
                }
            }
        }
        public void GetCurrentMaintenanceShiftAndItems()
        {
            this.dsShifts.Clear();
            this.dsItems.Clear();

            this.mfsCurrent.dtDatePty       = siShiftInfo.GetDate(DateTime.Now);
            this.mfsCurrent.shiShiftPty     = siShiftInfo.GetShift(DateTime.Now.TimeOfDay);
            this.mfsCurrent.strCaltegoryPty = "01";

            this.dsShifts = MaintenanceFurnaceShift.GetMFSs(this.cnConnection, this.mfsCurrent);
            //Shift Already Inserted
            if (this.dsShifts.Tables["tabMaintenanceFurnaceShifts"].Rows.Count != 0)
            {
                this.mfsCurrent.intIDPty    = (int)this.dsShifts.Tables["tabMaintenanceFurnaceShifts"].Rows[0]["intID"];
                this.mfsCurrent.strGroupPty = this.dsShifts.Tables["tabMaintenanceFurnaceShifts"].Rows[0]["nvcGroup"].ToString();

                this.dgvShifts.DataSource = this.dsShifts;
                this.dgvShifts.DataMember = "tabMaintenanceFurnaceShifts";

                this.mfiCurrent.intTabShiftIDPty = this.mfsCurrent.intIDPty;
                this.dsItems = MaintenanceFurnaceItem.GetMFIs(this.cnConnection, this.mfiCurrent, this.tbStoreCode.Text.Trim(), this.tbPersonCoID.Text.Trim());

                if (this.dsItems.Tables["tabMaintenanceFurnaceItems"].Rows.Count != 0)
                {
                    this.dgvItems.DataSource = this.dsItems;
                    this.dgvItems.DataMember = "tabMaintenanceFurnaceItems";
                }
            }
            //Insert Shift
            else
            {
                this.mfsCurrent.strGroupPty = siShiftInfo.GetGroup(siShiftInfo.GetDate(DateTime.Now)).ToString();
                this.mfsCurrent.Insert(this.cnConnection);
                GetCurrentMaintenanceShiftAndItems();
            }
        }