public int UpdateProductionOnSipmentFormatFile(ShipmentDetailFormats mFile)
        {
            //insert databse values
            SqlCommand updateComm = new SqlCommand();

            updateComm.Connection  = this.mConnectionUser;
            updateComm.CommandType = CommandType.Text;

            updateComm.Parameters.Add("@Sh_ShpID", SqlDbType.BigInt);
            updateComm.Parameters.Add("@Sh_ShipmentID", SqlDbType.NVarChar);
            updateComm.Parameters.Add("@Sh_Format", SqlDbType.NVarChar);
            updateComm.Parameters.Add("@Sh_ProductionStatus", SqlDbType.NVarChar);



            updateComm.Parameters["@Sh_ShpID"].Value            = mFile.ShpID;
            updateComm.Parameters["@Sh_ShipmentID"].Value       = mFile.ShipmentID;
            updateComm.Parameters["@Sh_Format"].Value           = mFile.FormatName;
            updateComm.Parameters["@Sh_ProductionStatus"].Value = mFile.ProductionStatus;


            updateComm.CommandText = "UPDATE ShipmentDetailFormats SET ProductionStatus='Process By User' WHERE ShpID=@Sh_ShpID AND ShipmentID=@Sh_ShipmentID AND FormatName=@Sh_Format";
            int ans = updateComm.ExecuteNonQuery();

            if (ans > 0)
            {
                return(ans);
            }
            else
            {
                return(0);
            }
        }
        public int AddShimpentFormats(ShipmentDetailFormats mShFormat)
        {
            //insert databse values
            SqlCommand insetComm = new SqlCommand();

            insetComm.Connection  = this.mConnectionUser;
            insetComm.CommandType = CommandType.Text;

            insetComm.Parameters.Add("@ShF_ShpID", SqlDbType.BigInt);
            insetComm.Parameters.Add("@ShF_ShipmentID", SqlDbType.NVarChar);
            insetComm.Parameters.Add("@ShF_FormatName", SqlDbType.NVarChar);
            insetComm.Parameters.Add("@ShF_ProductionStatus", SqlDbType.NVarChar);


            insetComm.Parameters["@ShF_ShpID"].Value            = mShFormat.ShpID;
            insetComm.Parameters["@ShF_ShipmentID"].Value       = mShFormat.ShipmentID;
            insetComm.Parameters["@ShF_FormatName"].Value       = mShFormat.FormatName;
            insetComm.Parameters["@ShF_ProductionStatus"].Value = mShFormat.ProductionStatus;

            insetComm.CommandText = "insert into ShipmentDetailFormats(ShpID,ShipmentID,FormatName,ProductionStatus)values(@ShF_ShpID,@ShF_ShipmentID,@ShF_FormatName,@ShF_ProductionStatus)";
            int ans = insetComm.ExecuteNonQuery();

            if (ans > 0)
            {
                return(ans);
            }
            else
            {
                return(0);
            }
        }
        public int UpdateShimpentFormats(ShipmentDetailFormats mShFormat)
        {
            //insert databse values
            SqlCommand updateComm = new SqlCommand();

            updateComm.Connection  = this.mConnectionUser;
            updateComm.CommandType = CommandType.Text;

            updateComm.Parameters.Add("@ShF_ShpID", SqlDbType.BigInt);
            updateComm.Parameters.Add("@ShF_ShipmentID", SqlDbType.NVarChar);
            updateComm.Parameters.Add("@ShF_FormatName", SqlDbType.NVarChar);

            updateComm.Parameters["@ShF_ShpID"].Value      = mShFormat.ShpID;
            updateComm.Parameters["@ShF_ShipmentID"].Value = mShFormat.ShipmentID;
            updateComm.Parameters["@ShF_FormatName"].Value = mShFormat.FormatName;

            updateComm.CommandText = "update ShipmentDetailFormats set ShipmentID=@ShF_ShipmentID, FormatName=@ShF_FormatName where ShpID=@ShF_ShpID";
            int ans = updateComm.ExecuteNonQuery();

            if (ans > 0)
            {
                return(ans);
            }
            else
            {
                return(0);
            }
        }
        public int DeleteFormatsByShID(ShipmentDetailFormats mShID)
        {
            //insert databse values
            SqlCommand deleteComm = new SqlCommand();

            deleteComm.Connection  = this.mConnectionUser;
            deleteComm.CommandType = CommandType.Text;

            deleteComm.Parameters.Add("@ShF_ShpID", SqlDbType.VarChar);

            deleteComm.Parameters["@ShF_ShpID"].Value = mShID.ShpID;


            deleteComm.CommandText = "delete from ShipmentDetailFormats where ShpID=@ShF_ShpID";
            int ans = deleteComm.ExecuteNonQuery();

            if (ans > 0)
            {
                return(ans);
            }
            else
            {
                return(0);
            }
        }
        private void btnDone_Click(object sender, EventArgs e)
        {
            ShipmentDetailFormats mShFormats = new ShipmentDetailFormats();

            DialogResult result;

            result = MessageBox.Show("Are you sure want to update file details?", "Update File Details", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (result == DialogResult.Yes)
            {
                ShipmetDetail            mShilmpent = new ShipmetDetail();
                ShipmentDetailFormatsMng ShFormats  = new ShipmentDetailFormatsMng(conn);



                mShilmpent.ShpID       = (int.Parse(lblTLbl.Text));
                mShilmpent.ShipmentID  = lblShipment.Text;
                mShilmpent.ISBN        = txtISBN.Text;
                mShilmpent.DISBN       = txtdISBN.Text;
                mShilmpent.Title       = txtBookTitle.Text;
                mShilmpent.Author      = txtAuthor.Text;
                mShilmpent.Author1     = txtAuthor2.Text;
                mShilmpent.PageCount   = int.Parse(txtPageCount.Text);
                mShilmpent.PCPCode     = txtPCPCode.Text;
                mShilmpent.Complexcity = cmbComplexcity.Text;
                mShilmpent.PubDate     = dateTimePickerPubDate.Value;
                mShilmpent.Publisher   = cmbPublisher.Text;
                mShilmpent.Language    = cmbLanguage.Text;
                mShilmpent.Team        = cmbTeamName.Text;
                mShilmpent.Comment     = txtComment.Text;

                ShipmentDetailMng ShipDetailMng = new ShipmentDetailMng(conn);


                if (ShipDetailMng.UpdateShipment(mShilmpent) > 0)
                {
                    MessageBox.Show("File details successfully updated..!", "Updated", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    ShipDetailMng.GetAllShipmentByName();
                }
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            try{
                DialogResult result;
                result = MessageBox.Show("Do you really want to register this shipment?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (cmbShipmentName.Text != "")
                {
                    if (cmbPDTeam.Text != "")
                    {
                        if (result == DialogResult.Yes)
                        {
                            if (dataGridViewDCDImport.DataSource != null)
                            {
                                //Create Object From User Object
                                ShipmetDetail         mShDetail  = new ShipmetDetail();
                                ShipmentHeader        mShHeader  = new ShipmentHeader();
                                ShipmentDetailFormats mShFormats = new ShipmentDetailFormats();

                                ShipmentHeaderMng        ShHeader  = new ShipmentHeaderMng(conn);
                                ShipmentDetailMng        ShDetail  = new ShipmentDetailMng(conn);
                                ShipmentDetailFormatsMng ShFormats = new ShipmentDetailFormatsMng(conn);

                                mShHeader.ShipmentID     = cmbShipmentName.Text;
                                mShHeader.DownloadedDate = dateTimePickerDCDImport.Value;
                                mShHeader.FileCount      = int.Parse(lblFileCount.Text.ToString());

                                if (ShHeader.AddShipmentHeader(mShHeader) > 0)
                                {
                                    //Loop until total Shipment File Count Registerd into the ShipmentDetails Tabele
                                    for (int i = 0; i < dataGridViewDCDImport.Rows.Count; i++)
                                    {
                                        //Load Selected Grid Row to frm_EditImportedFile for Edit
                                        // int rowIndex = dataGridViewDCDImport.CurrentRow.Index;

                                        string   sISBN         = dataGridViewDCDImport.Rows[i].Cells[0].Value.ToString();
                                        string   sdISBN        = dataGridViewDCDImport.Rows[i].Cells[1].Value.ToString();
                                        string   stxtBookTitle = dataGridViewDCDImport.Rows[i].Cells[2].Value.ToString();
                                        string   stxtAuthor    = dataGridViewDCDImport.Rows[i].Cells[3].Value.ToString();
                                        string   stxtAuthor1   = dataGridViewDCDImport.Rows[i].Cells[4].Value.ToString();
                                        int      sPageCount    = int.Parse(dataGridViewDCDImport.Rows[i].Cells[5].Value.ToString());
                                        DateTime sPubDate      = DateTime.Parse(dataGridViewDCDImport.Rows[i].Cells[6].Value.ToString());
                                        string   sPublisher    = dataGridViewDCDImport.Rows[i].Cells[7].Value.ToString();
                                        string   sLanguage     = dataGridViewDCDImport.Rows[i].Cells[8].Value.ToString();
                                        string   sFormat       = dataGridViewDCDImport.Rows[i].Cells[9].Value.ToString();
                                        string   sComment      = dataGridViewDCDImport.Rows[i].Cells[10].Value.ToString();
                                        string   sTeam         = cmbPDTeam.Text;



                                        // Assign User Interface data to User Object
                                        mShDetail.DownloadedDate   = dateTimePickerDCDImport.Value;
                                        mShDetail.ID               = cmbShipmentName.Text;
                                        mShDetail.Publisher        = sPublisher;
                                        mShDetail.ISBN             = sISBN;
                                        mShDetail.DISBN            = sdISBN;
                                        mShDetail.Title            = stxtBookTitle;
                                        mShDetail.Author           = stxtAuthor;
                                        mShDetail.Author1          = stxtAuthor1;
                                        mShDetail.PageCount        = sPageCount;
                                        mShDetail.PubDate          = sPubDate;
                                        mShDetail.Language         = sLanguage;
                                        mShDetail.Format           = sFormat;
                                        mShDetail.Comment          = sComment;
                                        mShDetail.DateOfAllocation = dateTimePickerAllocatedDate.Value;
                                        mShDetail.Team             = sTeam;
                                        mShDetail.TATDelivery      = 0;
                                        mShDetail.ProductionDone   = 0;
                                        mShDetail.QRDone           = 0;
                                        mShDetail.TransmissionDone = 0;
                                        mShDetail.ClientFeedback   = 0;


                                        if (ShDetail.AddSipmentFile(mShDetail) > 0)
                                        {
                                            // For each uutput formats dedicate a column
                                            //string fePub
                                            //string fMobi
                                            //string fWEB
                                            //string fDoc
                                            //string fAFF For Apple Fixed Book
                                            //string fKF8 For Kindle Fixed Book
                                            //string fKCC For Kindle Comic Book
                                            //string fePib For B&N Fixed Book

                                            mShFormats.ShipmentID = cmbShipmentName.Text;
                                            mShFormats.ShpID      = ShDetail.GetLastID();
                                            List <String> LFormat = ShFormats.GetAllFormats();
                                            mShFormats.ProductionStatus = "Not Assigned";


                                            var s1 = sFormat.Split('/');
                                            for (int x = 0; x < s1.Length; x++)
                                            {
                                                for (int y = 0; y < LFormat.Count(); y++)
                                                {
                                                    if (s1[x].ToString() == LFormat[y])
                                                    {
                                                        mShFormats.FormatName = LFormat[y].ToString();
                                                    }
                                                }

                                                ShFormats.AddShimpentFormats(mShFormats);
                                            }
                                        }
                                    }

                                    MessageBox.Show("New Shipment been registered..!\n\nShipment Name: " + mShDetail.ID + "\nTotal File(s): " + (dataGridViewDCDImport.Rows.Count), "Shipment Registerd", MessageBoxButtons.OK, MessageBoxIcon.Information);

                                    //Clear Header Details registered after shipment
                                    dataGridViewDCDImport.DataSource = null;
                                    lblFileCount.Text  = "";
                                    lblImportPath.Text = "";
                                    dataGridViewDCDInventory.Focus();
                                    RefreshData();
                                    cmbShipmentName.Text = "";
                                    btnImport.Enabled    = false;
                                }
                            }
                            else
                            {
                                MessageBox.Show("There is no new Shipment to import! \nPlease import provided excel file.", "Empty Shipment", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                btnImport.Focus();
                            }
                        }
                        else
                        {
                        }
                    }
                    else
                    {
                        MessageBox.Show("Please select a Team to allocate shipment!", "Empty Team", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        cmbPDTeam.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("There is no Shipment to import!.", "Empty Shipment", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    cmbShipmentName.Focus();
                }
            }
            catch (Exception ex) {
                if (ex.HResult == -2146232060)
                {
                    MessageBox.Show("This shipment is already imported..!\n Please check shipment name again.", "Cannot Import", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("Error" + ex.Message);
                }
            }
        }
Пример #7
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            try{
                //Message for Error when Shipment Fied is empty
                if (cmbShipment.Text.ToString() == "")
                {
                    MessageBox.Show("Please select a Shipment", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                else
                {
                    if (cbmSAllFiles.Checked == true && cmbShipment.Text.ToString() != "")
                    {
                        //Initialize Message Result
                        DialogResult result;
                        result = MessageBox.Show("Do you really want to delete \"" + cmbShipment.Text + "\"?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);


                        if (result == System.Windows.Forms.DialogResult.Yes)
                        {
                            //Create Object From ShipmetDetail Object
                            ShipmetDetail              mShipment                   = new ShipmetDetail();
                            ShipmentHeader             mShipmentHeader             = new ShipmentHeader();
                            ShipmentDetailFormats      mShipmentDetailFormats      = new ShipmentDetailFormats();
                            TATDelivery                mTATDelivery                = new TATDelivery();
                            ProductionManagementDetail mProductionManagementDetail = new ProductionManagementDetail();
                            ProductionManagementHeader mProductionManagementHeader = new ProductionManagementHeader();


                            // Assign Shipment Delete Interface data to mShipmentID
                            String mShipmentID = cmbShipment.Text.ToString();


                            //Create Services
                            ShipmentDetailMng             mShipmentMng                   = new ShipmentDetailMng(conn);
                            ShipmentHeaderMng             mShipmentHeaderMng             = new ShipmentHeaderMng(conn);
                            ShipmentDetailFormatsMng      mShipmentDetailFormatsMng      = new ShipmentDetailFormatsMng(conn);
                            TATDeliveryMng                mTATDeliveryMng                = new TATDeliveryMng(conn);
                            ProductionManagementDetailMng mProductionManagementDetailMng = new ProductionManagementDetailMng(conn);
                            ProductionManagementHeaderMng mProductionManagementHeaderMng = new ProductionManagementHeaderMng(conn);

                            mShipmentDetailFormatsMng.DeleteShimpentFormats(mShipmentID);
                            mShipmentMng.DeleteShipment(mShipmentID);
                            mShipmentHeaderMng.DeleteShipmentHeader(mShipmentID);



                            MessageBox.Show("\"" + cmbShipment.Text + "\" successfully deleted..!", " Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            frm_DCDImport DCDFrm = new frm_DCDImport();
                            RefreshData();
                            this.Dispose();
                        }
                        else
                        {
                            this.Dispose();
                        }
                    }

                    else if (cmbISBN.Text != "" && cmbShipment.Text.ToString() != "")
                    {
                        //Initialize Message Result
                        DialogResult result;
                        result = MessageBox.Show("Do you really want to delete ISBN " + cmbISBN.Text + "?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                        if (result == System.Windows.Forms.DialogResult.Yes)
                        {
                            //Create Object From ShipmetDetail Object
                            ShipmetDetail         mShipmentISBN          = new ShipmetDetail();
                            ShipmetDetail         mShipment              = new ShipmetDetail();
                            ShipmentDetailFormats mShipmentDetailFormats = new ShipmentDetailFormats();



                            // Assign Shipment Delete Interface data to mShipmentwithISBN Object
                            mShipment.ID       = cmbShipment.Text;
                            mShipmentISBN.ISBN = cmbISBN.Text;


                            ShipmentDetailMng        mShipmentMng              = new ShipmentDetailMng(conn);
                            ShipmentDetailMng        mShipmentMngShpID         = new ShipmentDetailMng(conn);
                            ShipmentDetailFormatsMng mShipmentDetailFormatsMng = new ShipmentDetailFormatsMng(conn);

                            if (mShipmentMng.DeleteShipmentFromID(mShipmentISBN, mShipment) > 0)
                            {
                                MessageBox.Show("ISBN " + mShipmentISBN.ISBN + " successfully deleted..!", "ISBN Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                RefreshData();
                                this.Dispose();
                            }
                        }
                        else if (result == DialogResult.No)
                        {
                            this.Close();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                if (ex.HResult == -2146232060)
                {
                    MessageBox.Show("This shipment is already in production!", "Cannot Delete", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("Error" + ex.Message);
                }
            }
        }
Пример #8
0
        private void btnAssignUID_Click(object sender, EventArgs e)
        {
            //validate User ID
            if (cmbUserID.Text != "")
            {
                try
                {
                    DialogResult result;
                    result = MessageBox.Show("Do You want to assign User " + cmbUserID.Text + " to this file?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    //Confirm by user
                    if (result == DialogResult.Yes)
                    {
                        //validate Production ID
                        if (cmbPID.Text != "")
                        {
                            int rowIndex = dataGridBeforeAssignedUID.CurrentRow.Index;

                            ProductionManagementHeader mProductionHdr = new ProductionManagementHeader();
                            ProductionManagementDetail mProductionDtl = new ProductionManagementDetail();
                            ShipmentDetailFormats      mShipmetDetail = new ShipmentDetailFormats();
                            ProductionStatus           mLog           = new ProductionStatus();

                            //Production Management Header Value
                            mProductionHdr.ShpID      = int.Parse(cmbPID.Text);
                            mProductionHdr.ShipmentID = cmbShipment.Text;
                            mProductionHdr.FormatName = cmbFormat.Text;

                            //Production Management Detail Value
                            mProductionDtl.ShpID            = int.Parse(cmbPID.Text);
                            mProductionDtl.ShipmentID       = cmbShipment.Text;
                            mProductionDtl.Format           = cmbFormat.Text;
                            mProductionDtl.ISBN             = dataGridBeforeAssignedUID.Rows[rowIndex].Cells[2].Value.ToString();
                            mProductionDtl.UserID           = cmbUserID.Text;
                            mProductionDtl.PageCount        = int.Parse(dataGridBeforeAssignedUID.Rows[rowIndex].Cells[8].Value.ToString());
                            mProductionDtl.StartDate        = dateTimePickerStartDate.Value;
                            mProductionDtl.ProductionStatus = "Process By User";

                            //Shipment Detail Formats Value
                            mShipmetDetail.ShpID            = int.Parse(cmbPID.Text);
                            mShipmetDetail.ShipmentID       = cmbShipment.Text;
                            mShipmetDetail.FormatName       = cmbFormat.Text;
                            mShipmetDetail.ProductionStatus = "Process By User";

                            //Production Status Log Value
                            mLog.ProductID  = int.Parse(cmbPID.Text);
                            mLog.ShipmentID = cmbShipment.Text;
                            mLog.ISBN       = dataGridBeforeAssignedUID.Rows[rowIndex].Cells[2].Value.ToString();
                            mLog.StartDate  = DateTime.Now;
                            mLog.FormatName = cmbFormat.Text;
                            mLog.UserID     = lblCUID.Text;
                            mLog.Status     = "Production assign to User " + cmbUserID.Text + " by Access User " + lblCUID.Text;

                            ProductionManagementDetailMng mProductionDtlMng  = new ProductionManagementDetailMng(conn);
                            ShipmentDetailFormatsMng      mShipmentDetailMng = new ShipmentDetailFormatsMng(conn);

                            //Add Prodution Management Header table
                            if (new ProductionManagementHeaderMng(this.conn).AddProductionManagementHeader(mProductionHdr) > 0)
                            {
                                //Update Shipment Format table
                                mShipmentDetailMng.UpdateProductionOnSipmentFormatFile(mShipmetDetail);

                                //Add Prodution Management Detail table
                                mProductionDtlMng.AddProductionManagementDetail(mProductionDtl);
                                MessageBox.Show("File has been assigned.\n\n ISBN: " + mProductionDtl.ISBN + "\n User ID: " + cmbUserID.Text + "\n Start Date: " + dateTimePickerStartDate.Value.ToString("dd/MMM/yyyy"), "File Assigned", MessageBoxButtons.OK, MessageBoxIcon.Information);

                                //Production Log table
                                new ProductionStatusLogMng(this.conn).AddProdustionStatus(mLog);
                                RefreshData();
                            }
                        }
                        else
                        {
                            MessageBox.Show("Production ID cannot be empty!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            cmbPID.Focus();
                        }
                    }
                }
                catch (Exception ex)
                {
                    if (ex.HResult == -2146232060)
                    {
                        MessageBox.Show("This Format is already assigned to a User.\n Please check Format & User ID again.", "Cannot Assign", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MessageBox.Show("Error" + ex.Message);
                    }
                }
            }
            else
            {
                MessageBox.Show("Plese select User ID to assign file.", "Cannot Assign", MessageBoxButtons.OK, MessageBoxIcon.Error);
                cmbUserID.Focus();
            }
        }
Пример #9
0
        private void btnRemoveUID_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult result;
                int          rowIndex = dataGridAfterAssignedUID.CurrentRow.Index;

                if (dataGridAfterAssignedUID.Rows[rowIndex].Cells[7].Value.ToString() == "Process By User")
                {
                    String ISBN = dataGridAfterAssignedUID.Rows[rowIndex].Cells[2].Value.ToString();

                    result = MessageBox.Show("Do you really want to remove User ID from ISBN: " + ISBN + "?", "Remove User from Assign File", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (result == DialogResult.Yes)
                    {
                        QRDetail                   mQRD                   = new QRDetail();
                        QRHeader                   mQRH                   = new QRHeader();
                        EmployeeProduction         mEMP                   = new EmployeeProduction();
                        ProductionManagementDetail mProductionDtl         = new ProductionManagementDetail();
                        ProductionManagementHeader mProductionHdr         = new ProductionManagementHeader();
                        ShipmentDetailFormats      mShipmentDetailFormats = new ShipmentDetailFormats();
                        ProductionStatus           mLog                   = new ProductionStatus();

                        //initilize values for QR Detail to delete
                        mQRD.ProductID  = int.Parse(dataGridAfterAssignedUID.Rows[rowIndex].Cells[0].Value.ToString());
                        mQRD.ShipmentID = dataGridAfterAssignedUID.Rows[rowIndex].Cells[1].Value.ToString();
                        mQRD.ISBN       = ISBN;
                        mQRD.FormatName = dataGridAfterAssignedUID.Rows[rowIndex].Cells[3].Value.ToString();

                        //initilize values for QR Header to delete
                        mQRH.ProductID  = int.Parse(dataGridAfterAssignedUID.Rows[rowIndex].Cells[0].Value.ToString());
                        mQRH.ShipmentID = dataGridAfterAssignedUID.Rows[rowIndex].Cells[1].Value.ToString();
                        mQRH.ISBN       = ISBN;
                        mQRH.FormatName = dataGridAfterAssignedUID.Rows[rowIndex].Cells[3].Value.ToString();

                        //initilize values for Employee Production to delete
                        mEMP.ProductID  = int.Parse(dataGridAfterAssignedUID.Rows[rowIndex].Cells[0].Value.ToString());
                        mEMP.ShipmentID = dataGridAfterAssignedUID.Rows[rowIndex].Cells[1].Value.ToString();
                        mEMP.ISBN       = ISBN;
                        mEMP.FormatName = dataGridAfterAssignedUID.Rows[rowIndex].Cells[3].Value.ToString();
                        mEMP.Status     = "Complete By User";

                        //initilize values for Production Detail to delete
                        mProductionDtl.ShpID      = int.Parse(dataGridAfterAssignedUID.Rows[rowIndex].Cells[0].Value.ToString());
                        mProductionDtl.ShipmentID = dataGridAfterAssignedUID.Rows[rowIndex].Cells[1].Value.ToString();
                        mProductionDtl.ISBN       = ISBN;
                        mProductionDtl.Format     = dataGridAfterAssignedUID.Rows[rowIndex].Cells[3].Value.ToString();

                        //initilize values for Production Detail Header to delete
                        mProductionHdr.ShpID      = int.Parse(dataGridAfterAssignedUID.Rows[rowIndex].Cells[0].Value.ToString());
                        mProductionHdr.ShipmentID = dataGridAfterAssignedUID.Rows[rowIndex].Cells[1].Value.ToString();
                        mProductionHdr.FormatName = dataGridAfterAssignedUID.Rows[rowIndex].Cells[3].Value.ToString();

                        //initilize values for Detail Format to delete
                        mShipmentDetailFormats.ShpID      = int.Parse(dataGridAfterAssignedUID.Rows[rowIndex].Cells[0].Value.ToString());
                        mShipmentDetailFormats.ShipmentID = dataGridAfterAssignedUID.Rows[rowIndex].Cells[1].Value.ToString();
                        mShipmentDetailFormats.FormatName = dataGridAfterAssignedUID.Rows[rowIndex].Cells[3].Value.ToString();

                        //Production Status Log Value
                        mLog.ProductID  = int.Parse(dataGridAfterAssignedUID.Rows[rowIndex].Cells[0].Value.ToString());
                        mLog.ShipmentID = dataGridAfterAssignedUID.Rows[rowIndex].Cells[1].Value.ToString();
                        mLog.ISBN       = dataGridBeforeAssignedUID.Rows[rowIndex].Cells[2].Value.ToString();
                        mLog.StartDate  = DateTime.Now;
                        mLog.FormatName = dataGridAfterAssignedUID.Rows[rowIndex].Cells[3].Value.ToString();
                        mLog.UserID     = lblCUID.Text;
                        String aUID = dataGridAfterAssignedUID.Rows[rowIndex].Cells[4].Value.ToString();
                        mLog.Status = "Removed assigned User " + aUID + " from Assgned Production by System Access User " + lblCUID.Text;

                        QRDetailMng                   mQRDMng                   = new QRDetailMng(conn);
                        QRHeaderMng                   mQRHMng                   = new QRHeaderMng(conn);
                        EmployeeProductionMng         mEPMMng                   = new EmployeeProductionMng(conn);
                        ProductionManagementDetailMng mShipmentDetailMng        = new ProductionManagementDetailMng(conn);
                        ProductionManagementHeaderMng mProductionHdrMng         = new ProductionManagementHeaderMng(conn);
                        ShipmentDetailFormatsMng      mShipmentDetailFormatsMng = new ShipmentDetailFormatsMng(conn);

                        // Delete Production Manegement Detail
                        if (mShipmentDetailMng.DeleteAssignedProductionManagementDetail(mProductionDtl) > 0)
                        {
                            // Delete Production Manegement Header
                            mProductionHdrMng.DeleteProductionManagementHeader(mProductionHdr);

                            // Delete QR Detail
                            if (mQRDMng.DeleteQRDetail(mQRD) > 0)
                            {
                                // Delete QR Header
                                mQRHMng.DeleteQRHeader(mQRH);
                            }
                            // Delete Employee Production
                            mEPMMng.DeleteUserProdcutionDone(mEMP);

                            // Update Employee Shipment Detail Formats to Not Assign
                            mShipmentDetailFormatsMng.UpdateProductionOnToBeAssignFormatFile(mShipmentDetailFormats);

                            MessageBox.Show("Selected assigned User successfully cleared from File..!", "Assigned File Clear", MessageBoxButtons.OK, MessageBoxIcon.Information);

                            //Production Log table
                            new ProductionStatusLogMng(this.conn).AddProdustionStatus(mLog);

                            RefreshData();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("This file is already in process by User. \nFirst modify status before remove User ID.", "Cannot Remove", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    btnModifyUID.Focus();
                }
            }
            catch (Exception ex)
            {
                if (ex.HResult == -2147467261)
                {
                    MessageBox.Show("First select a file to remove User ID.", "Cannot Remove", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    cmbShipment.Focus();
                }
                else
                {
                    MessageBox.Show("Error" + ex.Message);
                }
            }
        }