예제 #1
0
        private void btnSerach_Click(object sender, EventArgs e)
        {
            frmStationeryList objfrm = new frmStationeryList();

            //objfrm.lngVtype  = 9999;
            objfrm.onAddAllButtonClicked = new frmStationeryList.AddAllClick(DisplayVoucherList);
            objfrm.Show();
            objfrm.MdiParent = this.MdiParent;
            uctxtToLocation.Focus();
        }
예제 #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            mClear();
            frmStationeryList objfrm = new frmStationeryList();

            objfrm.intvType = intvType;
            objfrm.onAddAllButtonClicked = new frmStationeryList.AddAllClick(DisplayVoucherList);
            objfrm.lngFormPriv           = lngFormPriv;
            objfrm.strFormName           = strFormName;
            objfrm.Show();
            objfrm.MdiParent = this.MdiParent;
            uctxtInvoiceNo.Focus();
        }
예제 #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string i = "";

            if (ValidateFields() == false)
            {
                return;
            }
            string strBranchID = Utility.gstrGetBranchID(strComID, uctxtBranchName.Text);

            if (m_action == 1)
            {
                var strResponseInsert = MessageBox.Show("Do You  want to Save?", "Save Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (strResponseInsert == DialogResult.Yes)
                {
                    try
                    {
                        i = mSaveConsumtion();

                        if (i == "Inserted...")
                        {
                            if (Utility.gblnAccessControl)
                            {
                                string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, dteDate.Text, strFormName, uctxtInvoiceNo.Text,
                                                                         1, 0, (int)Utility.MODULE_TYPE.mtSTOCK, strBranchID);
                            }
                            mClear();
                            return;
                        }
                        else
                        {
                            MessageBox.Show(i.ToString());
                        }
                    }


                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString());
                    }
                }
            }
            else
            {
                var strResponseInsert = MessageBox.Show("Do You  want to Update?", "Save Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (strResponseInsert == DialogResult.Yes)
                {
                    try
                    {
                        i = mUpdateConsumtion();

                        if (i == "Updated...")
                        {
                            if (Utility.gblnAccessControl)
                            {
                                string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, dteDate.Text, strFormName, uctxtInvoiceNo.Text,
                                                                         2, 0, (int)Utility.MODULE_TYPE.mtSTOCK, strBranchID);
                            }
                            mClear();
                            frmStationeryList objfrm = new frmStationeryList();
                            objfrm.intvType = intvType;
                            objfrm.onAddAllButtonClicked = new frmStationeryList.AddAllClick(DisplayVoucherList);
                            objfrm.lngFormPriv           = lngFormPriv;
                            objfrm.strFormName           = strFormName;
                            objfrm.Show();
                            objfrm.MdiParent = this.MdiParent;
                            return;
                        }
                        else
                        {
                            MessageBox.Show(i.ToString());
                        }
                    }


                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString());
                    }
                }
            }
        }