コード例 #1
0
        private void DGMFGVoucherList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 9)
            {
                if (Utility.gblnAccessControl)
                {
                    if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 3))
                    {
                        MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                string strLockvoucher = Utility.gLockVocher(strComID, intvType);
                long   lngDate        = Convert.ToInt64(Convert.ToDateTime(DG.CurrentRow.Cells[5].Value.ToString().ToString()).ToString("yyyyMMdd"));
                if (strLockvoucher != "")
                {
                    long lngBackdate = Convert.ToInt64(Convert.ToDateTime(strLockvoucher).ToString("yyyyMMdd"));
                    if (lngDate <= lngBackdate)
                    {
                        MessageBox.Show("Invalid Date, Back Date is locked");
                        return;
                    }
                }
                if (intvType == (int)Utility.VOUCHER_TYPE.vtSTOCK_TRANSFER)
                {
                    string strcheck = objWIS.mCheckStockRequisition(strComID, DG.CurrentRow.Cells[0].Value.ToString());
                    if (strcheck != "")
                    {
                        MessageBox.Show(strcheck);
                        return;
                    }
                }
                var strResponse = MessageBox.Show("Do You  want to Delete?", "Delete Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (strResponse == DialogResult.Yes)
                {
                    double dblAmnt        = Convert.ToDouble(DG.CurrentRow.Cells[6].Value.ToString());
                    string strVoucherDate = DG.CurrentRow.Cells[5].Value.ToString();
                    string strBranchID    = "0001";

                    string i = objWIS.mDeleteStockTransfer(strComID, DG.CurrentRow.Cells[0].Value.ToString());

                    if (i == "Deleted...")
                    {
                        if (Utility.gblnAccessControl)
                        {
                            string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, strVoucherDate, strFormName, DG.CurrentRow.Cells[0].Value.ToString(),
                                                                     3, dblAmnt, (int)Utility.MODULE_TYPE.mtSTOCK, strBranchID);
                        }
                    }
                    MessageBox.Show(i.ToString());
                    DG.Rows.RemoveAt(e.RowIndex);
                }
            }
            if (e.ColumnIndex == 8)
            {
                if (Utility.gblnAccessControl)
                {
                    if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2))
                    {
                        MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                if (intvType == (int)Utility.VOUCHER_TYPE.vtSTOCK_TRANSFER)
                {
                    string strcheck = objWIS.mCheckStockRequisition(strComID, DG.CurrentRow.Cells[0].Value.ToString());
                    if (strcheck != "")
                    {
                        MessageBox.Show(strcheck);
                        return;
                    }
                }
                if (onAddAllButtonClicked != null)
                {
                    onAddAllButtonClicked(GetSelectedItem(), sender, e);
                }
                this.Dispose();
            }
            if (e.ColumnIndex == 10)
            {
                if (strFlag == "O")
                {
                    JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                    frmviewer.selector  = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.StockOut;
                    frmviewer.strString = DG.CurrentRow.Cells[0].Value.ToString();
                    frmviewer.intype    = intvType;
                    frmviewer.Show();
                }
                else if (strFlag == "I")
                {
                    JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                    frmviewer.selector  = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.StockIn;
                    frmviewer.strString = DG.CurrentRow.Cells[0].Value.ToString();
                    frmviewer.intype    = intvType;
                    frmviewer.Show();
                }
            }
        }
コード例 #2
0
        private void DGMFGVoucherList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.ColumnIndex == 5)
                {
                    if (Utility.gblnAccessControl)
                    {
                        if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2))
                        {
                            MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                    }
                    if (onAddAllButtonClicked != null)
                    {
                        onAddAllButtonClicked(GetSelectedItem(), sender, e);
                    }
                    this.Dispose();
                }
                if (e.ColumnIndex == 6)
                {
                    if (Utility.gblnAccessControl)
                    {
                        if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 3))
                        {
                            MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                    }
                    var strResponse = MessageBox.Show("Do You  want to Delete?", "Delete Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (strResponse == DialogResult.Yes)
                    {
                        double dblAmnt        = Convert.ToDouble(DGMFGVoucherList.CurrentRow.Cells[4].Value.ToString());
                        string strVoucherDate = DGMFGVoucherList.CurrentRow.Cells[3].Value.ToString();
                        //string strBranchID = Utility.gstrGetBranchID(strComID, DGMFGVoucherList.CurrentRow.Cells[10].Value.ToString());

                        string i = invms.mDeleteStockConum(strComID, DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString());
                        if (i == "Deleted...")
                        {
                            if (Utility.gblnAccessControl)
                            {
                                string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, strVoucherDate, strFormName, DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString(),
                                                                         3, 0, (int)Utility.MODULE_TYPE.mtSTOCK, "0001");
                            }
                            DGMFGVoucherList.Rows.RemoveAt(e.RowIndex);
                        }
                        MessageBox.Show(i.ToString());
                        //mfgVoucherList();
                    }
                }
                if (e.ColumnIndex == 7)
                {
                    if (intvType == (int)Utility.VOUCHER_TYPE.vtSTOCK_MFG_CONSUMPTION)
                    {
                        JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                        frmviewer.selector       = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.intventoryVoucher;
                        frmviewer.strFdate       = "";
                        frmviewer.strSummDetails = "Details";
                        frmviewer.strString      = DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString();
                        frmviewer.strSelction    = "C";
                        frmviewer.Show();
                    }
                    else if (intvType == (int)Utility.VOUCHER_TYPE.vtSTOCK_MFG_FINISHED_GOODS)
                    {
                        JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                        frmviewer.selector       = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.intventoryVoucher;
                        frmviewer.strFdate       = "";
                        frmviewer.strSummDetails = "Details";
                        frmviewer.strString      = DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString();
                        frmviewer.strSelction    = "F";
                        frmviewer.Show();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
コード例 #3
0
        //private void mVoucherList()
        //{
        //    int introw = 0;
        //    List<Stationery> oogrp;
        //    this.DG.DefaultCellStyle.Font = new Font("verdana", 9);
        //    DG.Rows.Clear();


        //    if (uctxtFindWhat.Text != "")
        //    {
        //        if (uctxtFindWhat.Text == "Voucher Number")
        //        {
        //            oogrp = objWIS.mFillStockRequisitionList(strComID, intvType, uctxtFindWhat.Text, uctxtExpression.Text, uctxtFromDate.Text, uctxtToDate.Text, Utility.gstrUserName).ToList();
        //        }
        //        else if (uctxtFindWhat.Text == "Voucher Date")
        //        {
        //            oogrp = objWIS.mFillStationeryList(strComID, intvType, uctxtFindWhat.Text, uctxtExpression.Text, uctxtFromDate.Text, uctxtToDate.Text, Utility.gstrUserName).ToList();
        //        }
        //        else
        //        {
        //            oogrp = objWIS.mFillStationeryList(strComID, intvType, uctxtFindWhat.Text, uctxtExpression.Text, uctxtFromDate.Text, uctxtToDate.Text, Utility.gstrUserName).ToList();
        //        }
        //    }
        //    else
        //    {
        //        oogrp = objWIS.mFillStationeryList(strComID, intvType, uctxtFindWhat.Text, uctxtExpression.Text, DateTime.Now.ToString("dd/MM/yyyy"), DateTime.Now.Date.ToString("dd/MM/yyyy"), Utility.gstrUserName).ToList();
        //    }



        //    if (oogrp.Count > 0)
        //    {
        //        foreach (Stationery ogrp in oogrp)
        //        {
        //            DG.Rows.Add();
        //            DG[0, introw].Value = ogrp.strinvRefNo;
        //            //DG[1, introw].Value = Utility.Mid(ogrp.strRefNo, 6, ogrp.strRefNo.Length - 6);
        //            DG[1, introw].Value = ogrp.strDate;
        //            DG[2, introw].Value = ogrp.dblinvAmount;
        //            //DGMFGVoucherList[5, introw].Value = ogrp.strBranchId;
        //            DG[3, introw].Value = ogrp.StringinvNarrations;
        //            DG[4, introw].Value = ogrp.strfromGodounName;
        //            DG[5, introw].Value = ogrp.strtoGodounName;
        //            DG[6, introw].Value = "Edit";
        //            //DGMFGVoucherList[5, introw].Value = "Print";
        //            DG[7, introw].Value = "Delete";
        //            DG[8, introw].Value = "View";
        //            DG[9, introw].Value = ogrp.strBranchName;


        //            introw += 1;
        //        }
        //        lblCount.Text = "Total Record: " + introw;
        //        DG.AllowUserToAddRows = false;
        //    }
        //}

        private void DGMFGVoucherList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 7)
            {
                //if (Utility.gblnAccessControl)
                //{
                //    if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 3))
                //    {
                //         MessageBox.Show("You have no Permission to Access","Privileges",MessageBoxButtons.OK,MessageBoxIcon.Warning );
                //        return;
                //    }
                //}
                var strResponse = MessageBox.Show("Do You  want to Delete?", "Delete Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (strResponse == DialogResult.Yes)
                {
                    string strcheck = objWIS.mCheckStockRequisition(strComID, DG.CurrentRow.Cells[0].Value.ToString());
                    if (strcheck != "")
                    {
                        MessageBox.Show(strcheck);
                        return;
                    }


                    double dblAmnt        = Convert.ToDouble(DG.CurrentRow.Cells[2].Value.ToString());
                    string strVoucherDate = DG.CurrentRow.Cells[1].Value.ToString();
                    string strBranchID    = "0001";

                    string i = objWIS.mDeleteStationery(strComID, DG.CurrentRow.Cells[0].Value.ToString());
                    if (i == "Deleted...")
                    {
                        if (Utility.gblnAccessControl)
                        {
                            string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, strVoucherDate, strFormName, DG.CurrentRow.Cells[0].Value.ToString(),
                                                                     3, dblAmnt, (int)Utility.MODULE_TYPE.mtSTOCK, strBranchID);
                        }
                    }
                    MessageBox.Show(i.ToString());
                    //mVoucherList();
                    DG.Rows.RemoveAt(e.RowIndex);
                }
            }
            if (e.ColumnIndex == 6)
            {
                //if (Utility.gblnAccessControl)
                //{
                //    if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2))
                //    {
                //         MessageBox.Show("You have no Permission to Access","Privileges",MessageBoxButtons.OK,MessageBoxIcon.Warning );
                //        return;
                //    }
                //}
                //string strcheck = objWIS.mCheckStockRequisition(strComID, DG.CurrentRow.Cells[0].Value.ToString());
                //if (strcheck != "")
                //{
                //    MessageBox.Show(strcheck);
                //    return;
                //}
                if (onAddAllButtonClicked != null)
                {
                    onAddAllButtonClicked(GetSelectedItem(), sender, e);
                }
                this.Dispose();
            }
            if (e.ColumnIndex == 8)
            {
                JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                frmviewer.selector    = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.Stationery;
                frmviewer.strFdate    = "";
                frmviewer.strString   = DG.CurrentRow.Cells[0].Value.ToString();
                frmviewer.strSelction = "T";
                frmviewer.Show();
            }
        }
コード例 #4
0
        private void DGMFGVoucherList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                string strmsg = "";

                if (e.ColumnIndex == 6)
                {
                    if (Utility.gblnAccessControl)
                    {
                        if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2))
                        {
                            MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                    }
                    if (Utility.gstrUserName.ToUpper() != "DEEPLAID")
                    {
                        strmsg = Utility.mGetCheckProductIonApproved(strComID, DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString());

                        if (strmsg != "")
                        {
                            MessageBox.Show(strmsg);
                            return;
                        }
                    }
                    if (onAddAllButtonClicked != null)
                    {
                        onAddAllButtonClicked(GetSelectedItem(), sender, e);
                    }
                    this.Dispose();
                }
                if (e.ColumnIndex == 7)
                {
                    if (Utility.gblnAccessControl)
                    {
                        if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 3))
                        {
                            MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                    }
                    strmsg = Utility.mGetCheckProductIonApproved(strComID, DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString());

                    if (strmsg != "")
                    {
                        MessageBox.Show("Approved Voucher Cannot be Delete..");
                        return;
                    }
                    string strLockvoucher = Utility.gLockVocher(strComID, intvType);
                    long   lngDate        = Convert.ToInt64(Convert.ToDateTime(DGMFGVoucherList.CurrentRow.Cells[4].Value.ToString()).ToString("yyyyMMdd"));
                    if (strLockvoucher != "")
                    {
                        long lngBackdate = Convert.ToInt64(Convert.ToDateTime(strLockvoucher).ToString("yyyyMMdd"));
                        if (lngDate <= lngBackdate)
                        {
                            MessageBox.Show("Invalid Date, Back Date is locked");
                            return;
                        }
                    }
                    var strResponse = MessageBox.Show("Do You  want to Delete?", "Delete Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (strResponse == DialogResult.Yes)
                    {
                        double dblAmnt        = Convert.ToDouble(DGMFGVoucherList.CurrentRow.Cells[5].Value.ToString());
                        string strVoucherDate = DGMFGVoucherList.CurrentRow.Cells[4].Value.ToString();
                        //string strBranchID = Utility.gstrGetBranchID(strComID, DGMFGVoucherList.CurrentRow.Cells[10].Value.ToString());

                        string i = invms.mDeleteStockConum(strComID, DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString());
                        if (i == "Deleted...")
                        {
                            if (Utility.gblnAccessControl)
                            {
                                string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, strVoucherDate, strFormName, DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString(),
                                                                         3, 0, (int)Utility.MODULE_TYPE.mtSTOCK, "0001");
                            }
                            DGMFGVoucherList.Rows.RemoveAt(e.RowIndex);
                        }
                        MessageBox.Show(i.ToString());
                        //mfgVoucherList();
                    }
                }
                if (e.ColumnIndex == 8)
                {
                    if (intvType == (int)Utility.VOUCHER_TYPE.vtSTOCK_MFG_CONSUMPTION)
                    {
                        String strRefNo = "";
                        strRefNo = DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString();

                        if (Utility.mGetRepakingCheck(strComID, strRefNo) == true)
                        {
                            JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                            frmviewer.selector       = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.Repaking;
                            frmviewer.strFdate       = "";
                            frmviewer.strSummDetails = "Details";
                            frmviewer.strString      = DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString();
                            frmviewer.strSelction    = "C";
                            frmviewer.Show();
                        }
                        else
                        {
                            JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                            frmviewer.selector       = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.intventoryVoucher;
                            frmviewer.strFdate       = "";
                            frmviewer.strSummDetails = "Details";
                            frmviewer.strString      = DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString();
                            frmviewer.strSelction    = "C";
                            frmviewer.Show();
                        }
                    }
                    else if (intvType == (int)Utility.VOUCHER_TYPE.vtSTOCK_MFG_FINISHED_GOODS)
                    {
                        JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                        frmviewer.selector       = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.intventoryVoucher;
                        frmviewer.strFdate       = "";
                        frmviewer.strSummDetails = "Details";
                        frmviewer.strString      = DGMFGVoucherList.CurrentRow.Cells[0].Value.ToString();
                        frmviewer.strSelction    = "F";
                        frmviewer.Show();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
コード例 #5
0
        private void DGMFGVoucherList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string strmsg = "";

            if (e.ColumnIndex == 7)
            {
                var strResponse = MessageBox.Show("Do You  want to Delete?", "Delete Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (strResponse == DialogResult.Yes)
                {
                    if (Utility.gblnAccessControl)
                    {
                        if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 3))
                        {
                            MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                    }
                    string i = objWIS.mDeleteMFG(strComID, DGMFGVoucherList.CurrentRow.Cells[1].Value.ToString(), DGMFGVoucherList.CurrentRow.Cells[9].Value.ToString(),
                                                 DGMFGVoucherList.CurrentRow.Cells[11].Value.ToString(), DGMFGVoucherList.CurrentRow.Cells[10].Value.ToString(), intConvert);
                    if (i == "Deleted...")
                    {
                        if (Utility.gblnAccessControl)
                        {
                            string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, DateTime.Now.ToString("dd/MM/yyyy"), strFormName, DGMFGVoucherList.CurrentRow.Cells[1].Value.ToString(),
                                                                     3, 0, (int)Utility.MODULE_TYPE.mtSTOCK, "0001");
                        }
                        mfgVoucherList(0);
                        MessageBox.Show(i.ToString());
                    }
                    else
                    {
                        MessageBox.Show(i.ToString());
                    }
                }
            }
            if (e.ColumnIndex == 6)
            {
                if (Utility.gblnAccessControl)
                {
                    if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2))
                    {
                        MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                strmsg = Utility.mGetCheckProductIonApproved(strComID, DGMFGVoucherList.CurrentRow.Cells[10].Value.ToString());

                if (strmsg != "")
                {
                    MessageBox.Show(strmsg);
                    return;
                }

                if (onAddAllButtonClicked != null)
                {
                    onAddAllButtonClicked(GetSelectedItem(), sender, e);
                }
                this.Dispose();
            }

            if (e.ColumnIndex == 8)
            {
                if (intConvert == 1)
                {
                    JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                    frmviewer.selector    = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.intventoryVoucher;
                    frmviewer.strFdate    = "";
                    frmviewer.strString   = DGMFGVoucherList.CurrentRow.Cells[10].Value.ToString();
                    frmviewer.strSelction = "M";
                    frmviewer.Show();
                }
                else
                {
                    JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                    frmviewer.selector    = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.Production;
                    frmviewer.strFdate    = "";
                    frmviewer.strString   = DGMFGVoucherList.CurrentRow.Cells[10].Value.ToString();
                    frmviewer.strSelction = "M";
                    frmviewer.Show();
                }
            }
        }
コード例 #6
0
        private void DG_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 8)
            {
                string strVoucherDate = DG.CurrentRow.Cells[3].Value.ToString();
                string strLockvoucher = Utility.gLockVocher(strComID, mintVType);
                long   lngDate        = Convert.ToInt64(Convert.ToDateTime(strVoucherDate).ToString("yyyyMMdd"));
                if (strLockvoucher != "")
                {
                    long lngBackdate = Convert.ToInt64(Convert.ToDateTime(strLockvoucher).ToString("yyyyMMdd"));
                    if (lngDate <= lngBackdate)
                    {
                        MessageBox.Show("Invalid Date, Back Date is locked");
                        return;
                    }
                }

                if (Utility.gblnAccessControl)
                {
                    if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 3))
                    {
                        MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                var strResponse = MessageBox.Show("Do You  want to Delete?", "Delete Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (strResponse == DialogResult.Yes)
                {
                    string i = invms.mDeleteSample(strComID, DG.CurrentRow.Cells[1].Value.ToString());
                    if (i == "Deleted...")
                    {
                        if (Utility.gblnAccessControl)
                        {
                            string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, DateTime.Now.ToString("dd/MM/yyyy"), "Sample", DG.CurrentRow.Cells[1].Value.ToString(),
                                                                     1, 0, (int)Utility.MODULE_TYPE.mtSALES, "0001");
                        }
                    }
                    MessageBox.Show(i.ToString());
                    mFetchRecord();
                }
            }

            if (e.ColumnIndex == 7)
            {
                if (Utility.gblnAccessControl)
                {
                    if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2))
                    {
                        MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                if (onAddAllButtonClicked != null)
                {
                    onAddAllButtonClicked(GetSelectedItem(), sender, e);
                }
                this.Dispose();
            }
            if (e.ColumnIndex == 9)
            {
                JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Inventory.Viewer.frmReportViewer();
                if (mintVType == 17)
                {
                    frmviewer.selector = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.individualSample;
                }
                else
                {
                    frmviewer.selector = JA.Modulecontrolar.UI.DReport.Inventory.ViewerSelector.intventoryVoucher;
                }
                frmviewer.strFdate    = "";
                frmviewer.strString   = DG.CurrentRow.Cells[1].Value.ToString();
                frmviewer.strSelction = "S";
                frmviewer.Show();
            }
        }