예제 #1
0
 private void mnuDetail_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         if (DBGrid.CurrentRow == null)
         {
             return;
         }
         BindingCollection <modAccProductInout> list = _dal.GetIList(cboAccName.ComboBox.SelectedValue.ToString(), DBGrid.CurrentRow.Cells["productid"].Value.ToString(), Util.IsTrialBalance, out Util.emsg);
         if (list != null && list.Count > 0)
         {
             frmViewList frm = new frmViewList();
             frm.InitViewList(list[0].ProductName, list);
             frm.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
예제 #2
0
        private void btnProduct_Click(object sender, EventArgs e)
        {
            dalWarehouseProductInout dal = new dalWarehouseProductInout();
            BindingCollection <modProductSizeWip> list = dal.GetProductSizeWip(Util.modperiod.AccName, out Util.emsg);
            frmViewList frm = new frmViewList();

            frm.InitViewList("请选择产品及尺寸:", list);
            frm.Selection = true;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                dalProductList dalpdt = new dalProductList();
                modProductList modpdt = dalpdt.GetItem(Util.retValue1, out Util.emsg);
                txtProductId.Text   = Util.retValue1;
                txtProductName.Text = Util.retValue2;
                txtSize.Text        = Util.retValue3;
                if (modpdt.SizeFlag == 1)
                {
                    txtSize.Enabled = true;
                }
                else
                {
                    txtSize.Enabled = false;
                }
                txtQty.Focus();
            }
        }
예제 #3
0
        private void mnuPurchaseList_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (DBGrid.CurrentRow == null)
                {
                    return;
                }

                modCustomerOrderList mod = (modCustomerOrderList)DBGrid.CurrentRow.DataBoundItem;
                dalPurchaseList      dal = new dalPurchaseList();
                BindingCollection <modVPurchaseDetail> list = dal.GetVDetail(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, mod.ProductId, string.Empty, mod.CustOrderNo, string.Empty, string.Empty, out Util.emsg);
                if (list != null && list.Count > 0)
                {
                    frmViewList frm = new frmViewList();
                    frm.InitViewList(clsTranslate.TranslateString("Purchase List"), list);
                    frm.ShowDialog();
                }
                else
                {
                    MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #4
0
 private void mnuAssetEvaluate_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         if (DBGrid.CurrentRow == null)
         {
             return;
         }
         modAssetList     mod = (modAssetList)DBGrid.CurrentRow.DataBoundItem;
         dalAssetEvaluate dal = new dalAssetEvaluate();
         BindingCollection <modAssetEvaluate> list = dal.GetIList(string.Empty, string.Empty, mod.AssetId, string.Empty, string.Empty, string.Empty, out Util.emsg);
         if (list != null && list.Count > 0)
         {
             frmViewList frm = new frmViewList();
             frm.InitViewList(clsTranslate.TranslateString("Asset Evaluate"), list);
             frm.ShowDialog();
         }
         else
         {
             MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
예제 #5
0
 private void toolImport_Click(object sender, EventArgs e)
 {
     try
     {
         frmViewList          frmsel   = new frmViewList();
         dalCustomerOrderList dalorder = new dalCustomerOrderList();
         BindingCollection <modCustomerOrderList> listorder = dalorder.GetIList(false, string.Empty, string.Empty, string.Empty, string.Empty, DateTime.Today.AddDays(-30).ToString("MM-dd-yyyy"), string.Empty, out Util.emsg);
         if (listorder != null)
         {
             frmsel.Selection = true;
             frmsel.InitViewList("请选择要导入的客户订单号:", listorder);
             if (frmsel.ShowDialog() == DialogResult.OK)
             {
                 EditDesignForm frm = new EditDesignForm();
                 frm.Import(Convert.ToInt32(Util.retValue1));
                 if (frm.ShowDialog() == DialogResult.OK)
                 {
                     LoadData();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #6
0
 private void toolImport_Click(object sender, EventArgs e)
 {
     try
     {
         frmViewList      frmsel  = new frmViewList();
         dalQuotationForm dalquot = new dalQuotationForm();
         BindingCollection <modVQuotationDetail> listquot = dalquot.GetVDetail(string.Empty, string.Empty, string.Empty, string.Empty, DateTime.Today.AddDays(-30).ToString("MM-dd-yyyy"), string.Empty, out Util.emsg);
         if (listquot != null)
         {
             frmsel.InitViewList("请选择要导入的客户报价单号:", listquot);
             frmsel.Selection = true;
             if (frmsel.ShowDialog() == DialogResult.OK)
             {
                 modVQuotationDetail mod = dalquot.GetDetailItem(Util.retValue1, Convert.ToInt32(Util.retValue2), out Util.emsg);
                 if (mod != null)
                 {
                     EditCustomerOrderList frm = new EditCustomerOrderList();
                     frm.ImportItem(mod);
                     if (frm.ShowDialog() == DialogResult.OK)
                     {
                         LoadData();
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #7
0
        private void mnuHistoryDetail_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (DBGrid.CurrentRow == null)
                {
                    return;
                }

                if (DBGrid.CurrentRow.Cells[0].Value == null || string.IsNullOrEmpty(DBGrid.CurrentRow.Cells[0].Value.ToString()))
                {
                    return;
                }

                BindingCollection <modVQuotationDetail> list = _dal.GetVDetail(string.Empty, string.Empty, DBGrid.CurrentRow.Cells[0].Value.ToString(), string.Empty, DateTime.Today.AddDays(-365).ToString("MM-dd-yyyy"), string.Empty, out Util.emsg);
                if (list != null)
                {
                    frmViewList frm = new frmViewList();
                    frm.InitViewList(clsTranslate.TranslateString("History Detail"), list);
                    frm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #8
0
        private void DBGrid_DoubleClick(object sender, EventArgs e)
        {
            if (DBGrid.CurrentRow == null)
            {
                return;
            }
            string statuslist = "9";

            if (chkNotAudit.Checked)
            {
                statuslist += ",0";
            }
            if (chkAudited.Checked)
            {
                statuslist += ",1";
            }

            BindingCollection <modProductionForm> list = new BindingCollection <modProductionForm>();

            if (DBGrid.CurrentRow.Index == DBGrid.RowCount - 1)
            {
                list = _dal.GetIList(statuslist, string.Empty, string.Empty, string.Empty, txtInvNo.Text.Trim(), txtDeptId.Text.Trim(), dtpFrom.Text, dtpTo.Text, out Util.emsg);
            }
            else
            {
                modProductionSummary moditem = (modProductionSummary)DBGrid.CurrentRow.DataBoundItem;
                list = _dal.GetIList(statuslist, string.Empty, string.Empty, string.Empty, txtInvNo.Text.Trim(), moditem.DeptId, dtpFrom.Text, dtpTo.Text, out Util.emsg);
            }
            if (list != null && list.Count > 0)
            {
                frmViewList frm = new frmViewList();
                frm.InitViewList(clsTranslate.TranslateString("Production Form"), list);
                frm.ShowDialog();
            }
        }
예제 #9
0
        private void DBGrid_DoubleClick(object sender, EventArgs e)
        {
            if (DBGrid.CurrentRow == null)
            {
                return;
            }
            string statuslist = "9";

            if (chkNotAudit.Checked)
            {
                statuslist += ",0";
            }
            if (chkAudited.Checked)
            {
                statuslist += ",1";
            }

            modAccExpenseSummary mod = (modAccExpenseSummary)DBGrid.CurrentRow.DataBoundItem;
            BindingCollection <modAccExpenseForm> list = _dal.GetIList(statuslist, string.Empty, mod.ExpenseId, mod.ExpenseMan, dtpFrom.Text, dtpTo.Text, out Util.emsg);

            if (list != null && list.Count > 0)
            {
                frmViewList frm = new frmViewList();
                frm.InitViewList(clsTranslate.TranslateString("Account Expense Form"), list);
                frm.ShowDialog();
            }
        }
예제 #10
0
        private void DBGrid2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            frmViewList           frm;
            modAccAssetDebtReport mod = (modAccAssetDebtReport)DBGrid2.CurrentRow.DataBoundItem;

            switch (mod.SubjectId)
            {
            case "5145":       //应付帐款
                dalAccPayableList dalpay = new dalAccPayableList();
                BindingCollection <modVendorPayableSummary> listpay = dalpay.GetVendorPayableSummary(cboAccName.ComboBox.SelectedValue.ToString(), out Util.emsg);
                if (listpay != null && listpay.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listpay);
                    frm.ShowDialog();
                }
                break;

            case "5125":       //应付票据
                dalAccCheckList dalcheck = new dalAccCheckList();
                BindingCollection <modAccCheckList> listcheck = dalcheck.GetIList("0", string.Empty, mod.SubjectId, string.Empty, string.Empty, string.Empty, out Util.emsg);
                frm = new frmViewList();
                frm.InitViewList(mod.SubjectName, listcheck);
                frm.ShowDialog();
                break;

            case "5155":       //其它应付款
                dalAccOtherPayable dalopay = new dalAccOtherPayable();
                BindingCollection <modOtherPayableSummary> listopay = dalopay.GetOtherPayableSummary(cboAccName.ComboBox.SelectedValue.ToString(), out Util.emsg);
                if (listopay != null && listopay.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listopay);
                    frm.ShowDialog();
                }
                break;

            default:
                dalAccReport dalrpt = new dalAccReport();
                BindingCollection <modAccCredenceDetail> listrpt = new BindingCollection <modAccCredenceDetail>();
                dalrpt.GetCredenceDetail(true, cboAccName.ComboBox.SelectedValue.ToString(), mod.SubjectId, Util.IsTrialBalance, ref listrpt, out Util.emsg);
                if (listrpt != null && listrpt.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listrpt);
                    frm.ShowDialog();
                }
                else
                {
                    if (!string.IsNullOrEmpty(Util.emsg))
                    {
                        MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                break;
            }
        }
예제 #11
0
 private void btnAssetId_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         dalAssetList dal = new dalAssetList();
         BindingCollection <modAssetList> list = dal.GetIList("1", string.Empty, string.Empty, string.Empty, out Util.emsg);
         if (list != null && list.Count > 0)
         {
             frmViewList frm = new frmViewList();
             frm.InitViewList("请选择资产:", list);
             frm.Selection = true;
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 modAssetList mod = dal.GetItem(Util.retValue1, out Util.emsg);
                 if (mod != null)
                 {
                     txtAssetId.Text   = mod.AssetId;
                     txtAssetName.Text = mod.AssetName;
                     txtNetMny.Text    = mod.NetMny.ToString();
                 }
                 else
                 {
                     MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
         }
         else
         {
             if (!string.IsNullOrEmpty(Util.emsg))
             {
                 MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
예제 #12
0
파일: GuiAccount.cs 프로젝트: 100009/hberp
        private void ACC_WAITING_AUDIT_LIST_Click(object sender, EventArgs e)
        {
            dalAccReport _dal = new dalAccReport();
            BindingCollection <modWaitingAuditList> list = _dal.GetWaitingAuditList(Util.modperiod.AccName, Util.modperiod.StartDate.ToString(), Util.modperiod.EndDate.ToString(), out Util.emsg);

            if (list != null)
            {
                frmViewList frm = new frmViewList();
                frm.InitViewList(clsTranslate.TranslateString("Waiting Audit List"), list);
                frm.ShowDialog();
            }
            else
            {
                MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
예제 #13
0
        private void DBGrid_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (DBGrid.CurrentCell == null)
                {
                    return;
                }
                if (DBGrid.CurrentCell.ColumnIndex == 0)
                {
                    return;
                }
                if (DBGrid.CurrentCell.Value == null)
                {
                    return;
                }

                string actiontype = string.Empty;
                if (DBGrid.CurrentCell.ColumnIndex < DBGrid.ColumnCount - 1)
                {
                    actiontype = DBGrid.Columns[DBGrid.CurrentCell.ColumnIndex].Name;
                }

                string actionman = string.Empty;
                if (DBGrid.CurrentCell.RowIndex < DBGrid.RowCount - 1)
                {
                    actionman = DBGrid.Rows[DBGrid.CurrentCell.RowIndex].Cells[0].Value.ToString();
                }
                BindingCollection <modCustomerLog> list = _dal.GetIList(string.Empty, string.Empty, actiontype, actionman, string.Empty, dtpFrom.Text, dtpTo.Text, out Util.emsg);
                if (list != null)
                {
                    frmViewList frm = new frmViewList();
                    frm.InitViewList(clsTranslate.TranslateString("Customer Log"), list);
                    frm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #14
0
        private void DBGrid_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (DBGrid.CurrentRow == null)
                {
                    return;
                }

                dalAccReport        dal = new dalAccReport();
                modAccExpenseReport mod = (modAccExpenseReport)DBGrid.CurrentRow.DataBoundItem;
                if (mod.SubjectId.IndexOf("9135") == 0)
                {
                    BindingCollection <modAccCredenceDetail> list = new BindingCollection <modAccCredenceDetail>();
                    dal.GetCredenceDetail(true, cboAccName.ComboBox.SelectedValue.ToString(), mod.SubjectId, Util.IsTrialBalance, ref list, out Util.emsg);
                    if (list != null && list.Count > 0)
                    {
                        frmViewList frm = new frmViewList();
                        frm.InitViewList(mod.SubjectName, list);
                        frm.ShowDialog();
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(Util.emsg))
                        {
                            MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #15
0
 private void mnuCustomerLog_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         if (DBGrid.CurrentRow == null)
         {
             return;
         }
         modCustomerList mod    = (modCustomerList)DBGrid.CurrentRow.DataBoundItem;
         dalCustomerLog  dallog = new dalCustomerLog();
         BindingCollection <modCustomerLog> listlog = dallog.GetIList(mod.CustId, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, out Util.emsg);
         if (listlog != null && listlog.Count > 0)
         {
             frmViewList frm = new frmViewList();
             frm.InitViewList(clsTranslate.TranslateString("Customer Log"), listlog);
             frm.ShowDialog();
         }
         else
         {
             if (!string.IsNullOrEmpty(Util.emsg))
             {
                 MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
예제 #16
0
 private void mnuAccProductInout2_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         if (DBGrid2.CurrentRow == null)
         {
             return;
         }
         dalAccProductInout dal = new dalAccProductInout();
         BindingCollection <modAccProductInout> list = dal.GetIList(DBGrid2.CurrentRow.Cells["productid"].Value.ToString(), false, out Util.emsg);
         if (list != null && list.Count > 0)
         {
             frmViewList frm = new frmViewList();
             frm.InitViewList(list[0].ProductName, list);
             frm.ShowDialog();
         }
         else
         {
             if (!string.IsNullOrEmpty(Util.emsg))
             {
                 MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
예제 #17
0
 private void txtContent_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         TextBox txt = (TextBox)sender;
         if (rbSchedule.Checked)
         {
             frmViewText frm = new frmViewText(clsTranslate.TranslateString("Action Schedule"), txt.Text.Trim());
             frm.ShowDialog();
         }
         else
         {
             string traceflaglist = string.Empty;
             if (rbCustomerLog.Checked)
             {
                 traceflaglist = "1";
             }
             dalCustomerLog dal = new dalCustomerLog();
             BindingCollection <modCustomerLog> list = dal.GetIList(string.Empty, string.Empty, string.Empty, txtSalesMan.Text, traceflaglist, ((TextBox)sender).Tag.ToString(), DateTime.Parse(txt.Tag.ToString()).AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss"), out Util.emsg);
             if (list != null)
             {
                 frmViewList frm = new frmViewList();
                 frm.InitViewList(clsTranslate.TranslateString("Customer Log"), list);
                 frm.ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
예제 #18
0
파일: GuiAccount.cs 프로젝트: 100009/hberp
        private void ACC_WAITING_AUDIT_LIST_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            dalAccReport dal = new dalAccReport();
            BindingCollection <modWaitingAuditList> list = dal.GetWaitingAuditList(Util.modperiod.AccName, Util.modperiod.StartDate.ToString("MM-dd-yyyy"), Util.modperiod.EndDate.ToString("MM-dd-yyyy"), out Util.emsg);

            if (list != null && list.Count > 0)
            {
                frmViewList frm = new frmViewList();
                frm.InitViewList("未处理单据清单", list);
                frm.ShowDialog();
            }
            else
            {
                if (!string.IsNullOrEmpty(Util.emsg))
                {
                    MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("没有找到未处理的数据", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
예제 #19
0
        private void btnCheckId_Click(object sender, EventArgs e)
        {
            dalAccCheckList dal = new dalAccCheckList();
            BindingCollection <modAccCheckList> list = dal.GetWaitingCredenceList(string.Empty, out Util.emsg);

            if (list != null)
            {
                frmViewList frm = new frmViewList();
                frm.InitViewList("请选择要承兑的支票:", list);
                frm.Selection = true;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    modAccCheckList mod = dal.GetItem(Convert.ToInt32(Util.retValue1), out Util.emsg);
                    txtCheckId.Text      = mod.Id.ToString();
                    txtSubjectName.Text  = mod.SubjectName;
                    txtCheckNo.Text      = mod.CheckNo;
                    txtCheckType.Text    = mod.CheckType;
                    txtBankName.Text     = mod.BankName;
                    txtCurrency.Text     = mod.Currency;
                    txtMny.Text          = mod.Mny.ToString();
                    txtExchangeRate.Text = mod.ExchangeRate.ToString();
                }
            }
        }
예제 #20
0
        private void txtProduct_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == Convert.ToChar(Keys.Enter) || e.KeyChar == Convert.ToChar(Keys.Space))
            {
                dalProductSalePrice dalprice            = new dalProductSalePrice();
                dalProductList      dal                 = new dalProductList();
                BindingCollection <modProductList> list = dal.GetIListByBarcode(txtProduct.Text.Trim(), out Util.emsg);
                if (list != null && list.Count > 0)
                {
                    if (list.Count == 1)
                    {
                        DataGridViewRow row = new DataGridViewRow();
                        row.CreateCells(DBGrid);

                        row.Height         = 40;
                        row.Cells[0].Value = list[0].ProductId;
                        row.Cells[1].Value = list[0].ProductName;
                        row.Cells[2].Value = list[0].Barcode;
                        row.Cells[3].Value = list[0].UnitNo;
                        row.Cells[4].Value = 1;
                        row.Cells[5].Value = dalprice.GetDefaultPrice(list[0].ProductId, out Util.emsg);
                        row.Cells[6].Value = decimal.Parse(row.Cells[5].Value.ToString());
                        row.Cells[8].Value = list[0].Specify;
                        DBGrid.Rows.Add(row);
                        row.Dispose();
                    }
                    else
                    {
                        frmViewList frm = new frmViewList();
                        frm.InitViewList("请选择商品:", list);
                        frm.Selection = true;
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            var             modPdt = list.Where(c => c.ProductId == Util.retValue1).First();
                            DataGridViewRow row    = new DataGridViewRow();
                            row.CreateCells(DBGrid);

                            row.Height         = 40;
                            row.Cells[0].Value = modPdt.ProductId;
                            row.Cells[1].Value = modPdt.ProductName;
                            row.Cells[2].Value = modPdt.Barcode;
                            row.Cells[3].Value = modPdt.UnitNo;
                            row.Cells[4].Value = 1;
                            row.Cells[5].Value = dalprice.GetDefaultPrice(modPdt.ProductId, out Util.emsg);
                            row.Cells[6].Value = decimal.Parse(row.Cells[5].Value.ToString());
                            row.Cells[8].Value = modPdt.Specify;
                            DBGrid.Rows.Add(row);
                            row.Dispose();
                        }
                    }
                    SumData();
                }
                else
                {
                    modProductList mod = dal.GetItem(txtProduct.Text.Trim(), out Util.emsg);
                    if (mod != null)
                    {
                        DataGridViewRow row = new DataGridViewRow();
                        row.CreateCells(DBGrid);

                        row.Height         = 40;
                        row.Cells[0].Value = mod.ProductId;
                        row.Cells[1].Value = mod.ProductName;
                        row.Cells[2].Value = mod.Barcode;
                        row.Cells[3].Value = mod.UnitNo;
                        row.Cells[4].Value = 1;
                        row.Cells[5].Value = dalprice.GetDefaultPrice(mod.ProductId, out Util.emsg);
                        row.Cells[6].Value = decimal.Parse(row.Cells[5].Value.ToString());
                        row.Cells[8].Value = mod.Specify;
                        DBGrid.Rows.Add(row);
                        row.Dispose();

                        SumData();
                    }
                    else
                    {
                        MessageBox.Show("没有找到商品!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }

                if (DBGrid.RowCount > 0)
                {
                    DBGrid.CurrentCell = DBGrid.Rows[DBGrid.RowCount - 1].Cells[4];
                }
                txtProduct.Text = string.Empty;
                txtProduct.Focus();
            }
        }
예제 #21
0
        private void DBGrid_DoubleClick(object sender, EventArgs e)
        {
            if (DBGrid.CurrentRow == null)
            {
                return;
            }
            string statuslist = "9";

            if (chkNotAudit.Checked)
            {
                statuslist += ",0";
            }
            if (chkAudited.Checked)
            {
                statuslist += ",1";
            }

            string paystatuslist = string.Empty;

            if (chkPay0.Checked)
            {
                paystatuslist += ",0";
            }
            if (chkPay1.Checked)
            {
                paystatuslist += ",1";
            }

            string invoicestatuslist = string.Empty;

            if (chkInvoice0.Checked)
            {
                invoicestatuslist += ",0";
            }
            if (chkInvoice1.Checked)
            {
                invoicestatuslist += ",1";
            }
            if (chkInvoice2.Checked)
            {
                invoicestatuslist += ",2";
            }

            string vendorlist = string.Empty;

            if (lstVendor.SelectedItems.Count > 0 && lstVendor.SelectedItems.Count < lstVendor.Items.Count)
            {
                for (int i = 0; i < lstVendor.SelectedItems.Count; i++)
                {
                    modVendorList mod = (modVendorList)lstVendor.SelectedItems[i];
                    if (i == 0)
                    {
                        vendorlist = mod.VendorName;
                    }
                    else
                    {
                        vendorlist += "," + mod.VendorName;
                    }
                }
            }

            BindingCollection <modVPurchaseDetail> list = new BindingCollection <modVPurchaseDetail>();

            if (DBGrid.CurrentRow.Index == DBGrid.RowCount - 1)
            {
                list = _dal.GetVDetail(statuslist, cboPurchaseType.SelectedValue.ToString(), vendorlist, string.Empty, string.Empty, paystatuslist, invoicestatuslist, string.Empty, string.Empty, string.Empty, string.Empty, dtpFrom.Text, dtpTo.Text, out Util.emsg);
            }
            else
            {
                modPurchaseSummary moditem = (modPurchaseSummary)DBGrid.CurrentRow.DataBoundItem;
                list = _dal.GetVDetail(string.Empty, moditem.PurchaseType, moditem.VendorName, string.Empty, string.Empty, paystatuslist, invoicestatuslist, moditem.Currency, string.Empty, string.Empty, string.Empty, dtpFrom.Text, dtpTo.Text, out Util.emsg);
            }
            if (list != null && list.Count > 0)
            {
                frmViewList frm = new frmViewList();
                frm.InitViewList(clsTranslate.TranslateString("Purchase List"), list);
                frm.ShowDialog();
            }
        }
예제 #22
0
        private void toolTrial_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                Util.emsg   = string.Empty;
                dalAccReport dal = new dalAccReport();
                BindingCollection <modWaitingAuditList> list = dal.GetWaitingAuditList(Util.modperiod.AccName, Util.modperiod.StartDate.ToString(), Util.modperiod.EndDate.ToString(), out Util.emsg);
                if (list != null && list.Count > 0)
                {
                    frmViewList frmvl = new frmViewList();
                    frmvl.InitViewList(clsTranslate.TranslateString("Waiting Audit List"), list);
                    frmvl.ShowDialog();
                    if (MessageBox.Show("您本月还有未完成单据,您是否要试算?", clsTranslate.TranslateString("Confirm"), MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
                    {
                        return;
                    }
                }
                BindingCollection <modAccountBalance> list2 = dal.GetAccountBalance(Util.modperiod.AccName, false, out Util.emsg);
                if (list2 != null && list2.Count > 0)
                {
                    foreach (modAccountBalance mod in list2)
                    {
                        if (mod.SubjectId != "1030" && Math.Abs(mod.Differ) > Convert.ToDecimal("1"))
                        {
                            MessageBox.Show("财务数据不平衡,请先联系程序员检查原因并修正错误!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                            frmViewList frmvl = new frmViewList();
                            frmvl.InitViewList(clsTranslate.TranslateString("Account Balance"), list2);
                            frmvl.ShowDialog();
                            return;
                        }
                    }
                }
                else if (!string.IsNullOrEmpty(Util.emsg))
                {
                    MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                EditAccCredenceList frm = new EditAccCredenceList();
                frm.AddItem("试算平衡", string.Empty);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    Util.IsTrialBalance = true;
                    LoadData();
                    MessageBox.Show("试算操作成功,您现在查到的财务报表是您试算之后的数据!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    frmMain frmmain = (frmMain)this.ParentForm;
                    ((Label)frmmain.Controls.Find("lblTrialBalance", true).First()).Visible = true;
                    toolNew.Visible     = false;
                    toolEdit.Visible    = false;
                    toolDel.Visible     = false;
                    toolAudit.Visible   = false;
                    toolReset.Visible   = false;
                    toolTrial.Visible   = false;
                    toolBalance.Visible = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #23
0
        private void DBGrid_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (DBGrid.CurrentRow == null)
                {
                    return;
                }

                frmViewList       frm = new frmViewList();
                modAccountBalance mod = (modAccountBalance)DBGrid.CurrentRow.DataBoundItem;
                switch (mod.SubjectId)
                {
                case "1030":       //现金银行
                    BindingCollection <modAccCredenceDetail> listcash = _dal.GetCashAndBankDetail(Util.modperiod.AccName, Util.IsTrialBalance, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listcash);
                    break;

                case "1235":       //库存商品
                    dalAccProductInout dalpdt = new dalAccProductInout();
                    BindingCollection <modAccProductSummary> listpdt = dalpdt.GetAccProductSummary(Util.modperiod.AccName, Util.IsTrialBalance, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listpdt);
                    break;

                case "1055":       //应收帐款
                    dalAccReceivableList dalrec = new dalAccReceivableList();
                    BindingCollection <modCustReceivableSummary> listrec = dalrec.GetCustReceivableSummary(Util.modperiod.AccName, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listrec);
                    break;

                case "5145":       //应付账款
                    dalAccPayableList dalpay = new dalAccPayableList();
                    BindingCollection <modVendorPayableSummary> listpay = dalpay.GetVendorPayableSummary(Util.modperiod.AccName, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listpay);
                    break;

                case "1060":       //其它应收款
                    dalAccOtherReceivable dalorec = new dalAccOtherReceivable();
                    BindingCollection <modOtherReceivableSummary> listorec = dalorec.GetOtherReceivableSummary(Util.modperiod.AccName, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listorec);
                    break;

                case "5155":       //其他应付款
                    dalAccOtherPayable dalopay = new dalAccOtherPayable();
                    BindingCollection <modOtherPayableSummary> listopay = dalopay.GetOtherPayableSummary(Util.modperiod.AccName, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listopay);
                    break;

                case "1075":       //应收票据
                    dalAccCheckList dalcheckrec = new dalAccCheckList();
                    BindingCollection <modAccCheckList> listcheckrec = dalcheckrec.GetIList("0", string.Empty, mod.SubjectId, string.Empty, string.Empty, string.Empty, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listcheckrec);
                    break;

                case "5125":       //应付票据
                    dalAccCheckList dalcheckpay = new dalAccCheckList();
                    BindingCollection <modAccCheckList> listcheckpay = dalcheckpay.GetIList("0", string.Empty, mod.SubjectId, string.Empty, string.Empty, string.Empty, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listcheckpay);
                    break;

                default:
                    break;
                }
                frm.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #24
0
 private void DBGrid_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         if (DBGrid.CurrentRow == null)
         {
             return;
         }
         string           productid   = DBGrid.CurrentRow.Cells["ProductId"].Value.ToString();
         string           warehouseid = string.Empty;
         string           size        = string.Empty;
         string           fromdate    = string.Empty;
         string           todate      = string.Empty;
         modAccPeriodList mod         = (modAccPeriodList)cboAccName.SelectedItem;
         fromdate = mod.StartDate.ToString("MM-dd-yyyy");
         if (mod.LockFlag == 0)
         {
             todate = mod.EndDate >= DateTime.Today ? mod.EndDate.ToString("MM-dd-yyyy") : DateTime.Today.ToString("MM-dd-yyyy");
         }
         else
         {
             todate = mod.EndDate.ToString("MM-dd-yyyy");
         }
         if (rbProductSizeWip.Checked)
         {
             size = DBGrid.CurrentRow.Cells["size"].Value.ToString();
         }
         else if (rbWarehouseProductWip.Checked)
         {
             warehouseid = DBGrid.CurrentRow.Cells["warehouseid"].Value.ToString();
         }
         else if (rbWarehouseProductSizeWip.Checked)
         {
             warehouseid = DBGrid.CurrentRow.Cells["warehouseid"].Value.ToString();
             size        = DBGrid.CurrentRow.Cells["size"].Value.ToString();
         }
         BindingCollection <modWarehouseProductInout> list = _dal.GetIList(warehouseid, productid, string.Empty, size, string.Empty, fromdate, todate, out Util.emsg);
         if (list != null && list.Count > 0)
         {
             frmViewList frm = new frmViewList();
             frm.InitViewList(this.Text, list);
             frm.ShowDialog();
         }
         else
         {
             if (!string.IsNullOrEmpty(Util.emsg))
             {
                 MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
예제 #25
0
파일: frmDatabase.cs 프로젝트: 100009/hberp
        private void toolExecute_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtSql.Text.Trim()))
            {
                return;
            }

            try
            {
                this.Cursor = Cursors.WaitCursor;
                CloseAll();
                string[] sql;
                if (txtSql.SelectionLength == 0)
                {
                    sql = txtSql.Text.Trim().Split(';');
                }
                else
                {
                    sql = txtSql.SelectedText.Trim().Split(';');
                }
                for (int i = 0; i < sql.Length; i++)
                {
                    if (!string.IsNullOrEmpty(sql[i].Trim()))
                    {
                        string[] f         = sql[i].Split(' ');
                        string   tablename = string.Empty;
                        switch (f[0].ToUpper().Trim())
                        {
                        case "SELECT":
                            try
                            {
                                for (int k = 0; k < f.Length; k++)
                                {
                                    if (f[k].ToUpper().Trim() == "FROM")
                                    {
                                        if (f.Length > k + 1)
                                        {
                                            tablename = f[k + 1];
                                        }
                                        break;
                                    }
                                }
                                DataSet ds = SqlHelper.ExecuteDs(sql[i]);
                                if (ds != null)
                                {
                                    frmViewList frm = new frmViewList((i + 1).ToString() + ".Select " + tablename, ds);
                                    ShowMDIChild(frm, frm);
                                }
                            }
                            catch (Exception ex)
                            {
                                frmViewText frm = new frmViewText((i + 1).ToString() + ".Select " + tablename, sql[i] + "\r\n\r\n" + ex.Message.ToString());
                                ShowMDIChild(frm, frm);
                            }
                            break;

                        case "DELETE":
                        case "TRUNCATE":
                        case "DROP":
                            frmViewText frmt = new frmViewText(i.ToString(), "You are not permitted to operater like this!");
                            ShowMDIChild(frmt, frmt);
                            break;

                        case "INSERT":
                        case "UPDATE":
                            try
                            {
                                for (int k = 0; k < f.Length; k++)
                                {
                                    if (f[k].ToUpper().Trim() == "FROM")
                                    {
                                        if (f.Length > k + 1)
                                        {
                                            tablename = f[k + 1];
                                        }
                                        break;
                                    }
                                }
                                int iRet = SqlHelper.ExecuteNonQuery(sql[i]);
                                if (iRet >= 0)
                                {
                                    frmViewText frme = new frmViewText((i + 1).ToString() + "." + f[0] + " " + tablename, sql[i] + "\r\n\r\n Execute Success");
                                    ShowMDIChild(frme, frme);
                                }
                            }
                            catch (Exception ex)
                            {
                                frmViewText frme = new frmViewText((i + 1).ToString() + "." + f[0] + " " + tablename, sql[i] + "\r\n\r\n" + ex.Message.ToString());
                                ShowMDIChild(frme, frme);
                            }
                            break;

                        default:
                            frmViewText frmd = new frmViewText(i.ToString(), "You are not permitted to operater like this!");
                            ShowMDIChild(frmd, frmd);
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #26
0
        private void DBGrid_DoubleClick(object sender, EventArgs e)
        {
            if (DBGrid.CurrentRow == null)
            {
                return;
            }
            string statuslist = "9";

            if (chkNotAudit.Checked)
            {
                statuslist += ",0";
            }
            if (chkAudited.Checked)
            {
                statuslist += ",1";
            }

            string paystatuslist = string.Empty;

            if (chkPay0.Checked)
            {
                paystatuslist += ",0";
            }
            if (chkPay1.Checked)
            {
                paystatuslist += ",1";
            }

            string invoicestatuslist = string.Empty;

            if (chkInvoice0.Checked)
            {
                invoicestatuslist += ",0";
            }
            if (chkInvoice1.Checked)
            {
                invoicestatuslist += ",1";
            }
            if (chkInvoice2.Checked)
            {
                invoicestatuslist += ",2";
            }

            string custlist = string.Empty;

            if (lstCustomer.SelectedItems.Count > 0 && lstCustomer.SelectedItems.Count < lstCustomer.Items.Count)
            {
                for (int i = 0; i < lstCustomer.SelectedItems.Count; i++)
                {
                    modCustomerList mod = (modCustomerList)lstCustomer.SelectedItems[i];
                    if (i == 0)
                    {
                        custlist = mod.CustId;
                    }
                    else
                    {
                        custlist += "," + mod.CustId;
                    }
                }
            }

            BindingCollection <modSalesDesignForm> list = new BindingCollection <modSalesDesignForm>();

            if (DBGrid.CurrentRow.Index == DBGrid.RowCount - 1)
            {
                list = _dal.GetIList(statuslist, cboFormType.SelectedValue.ToString(), custlist, string.Empty, string.Empty, string.Empty, string.Empty, paystatuslist, invoicestatuslist, dtpFrom.Text, dtpTo.Text, out Util.emsg);
            }
            else
            {
                modSalesDesignSummary moditem = (modSalesDesignSummary)DBGrid.CurrentRow.DataBoundItem;
                list = _dal.GetIList(string.Empty, moditem.FormType, moditem.CustId, string.Empty, string.Empty, string.Empty, string.Empty, paystatuslist, invoicestatuslist, dtpFrom.Text, dtpTo.Text, out Util.emsg);
            }
            if (list != null && list.Count > 0)
            {
                frmViewList frm = new frmViewList();
                frm.InitViewList(clsTranslate.TranslateString("Sales Shipment Detail"), list);
                frm.ShowDialog();
            }
        }
예제 #27
0
        private void toolBalance_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                Util.emsg   = string.Empty;
                dalAccReport dal = new dalAccReport();
                BindingCollection <modWaitingAuditList> list = dal.GetWaitingAuditList(Util.modperiod.AccName, Util.modperiod.StartDate.ToString(), Util.modperiod.EndDate.ToString(), out Util.emsg);
                if (list != null && list.Count > 0)
                {
                    MessageBox.Show("您本月还有未完成单据,不能结算!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    frmViewList frmvl = new frmViewList();
                    frmvl.InitViewList(clsTranslate.TranslateString("Waiting Audit List"), list);
                    frmvl.ShowDialog();
                    return;
                }
                BindingCollection <modAccountBalance> list2 = dal.GetAccountBalance(Util.modperiod.AccName, Util.IsTrialBalance, out Util.emsg);
                if (list2 != null && list2.Count > 0)
                {
                    foreach (modAccountBalance mod in list2)
                    {
                        if (Math.Abs(mod.Differ) >= Convert.ToDecimal("0.5"))
                        {
                            MessageBox.Show("财务数据不平衡,请先联系程序员检查原因并修正错误!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                            frmViewList frmvl = new frmViewList();
                            frmvl.InitViewList(clsTranslate.TranslateString("Account Balance"), list2);
                            frmvl.ShowDialog();
                            return;
                        }
                    }
                }
                else if (!string.IsNullOrEmpty(Util.emsg))
                {
                    MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                EditAccCredenceList frm = new EditAccCredenceList();
                frm.AddItem("月末结算", string.Empty);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    Util.IsTrialBalance = false;
                    LoadData();
                    EditAccPeriodList frmapl = new EditAccPeriodList();
                    frmapl.InitForm(Util.modperiod.EndDate.AddDays(1));
                    frmapl.AddItem(Util.UserId);
                    if (frmapl.ShowDialog() == DialogResult.OK)
                    {
                        Util.modperiod.LockFlag = 1;
                        dalAccAnalyzeProfit dalprofit = new dalAccAnalyzeProfit();
                        dalprofit.Generate(Util.modperiod.AccName, Util.IsTrialBalance, out Util.emsg);

                        dalAccAnalyzeSales dalsales = new dalAccAnalyzeSales();
                        dalsales.Generate(Util.modperiod.AccName, out Util.emsg);

                        dalAccAnalyzePurchase dalpur = new dalAccAnalyzePurchase();
                        dalpur.Generate(Util.modperiod.AccName, out Util.emsg);

                        dalAccAnalyzeWaste dalwaste = new dalAccAnalyzeWaste();
                        dalwaste.Generate(Util.modperiod.AccName, out Util.emsg);

                        dalAccAnalyzeProduct dalpdt = new dalAccAnalyzeProduct();
                        dalpdt.Generate(Util.modperiod.AccName, out Util.emsg);
                        Application.Exit();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #28
0
        private void DBGrid1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            frmViewList           frm;
            modAccAssetDebtReport mod = (modAccAssetDebtReport)DBGrid1.CurrentRow.DataBoundItem;

            switch (mod.SubjectId)
            {
            case "1055":       //应收帐款
                dalAccReceivableList dalrec = new dalAccReceivableList();
                BindingCollection <modCustReceivableSummary> listrec = dalrec.GetCustReceivableSummary(cboAccName.ComboBox.SelectedValue.ToString(), out Util.emsg);
                if (listrec != null && listrec.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listrec);
                    frm.ShowDialog();
                }
                break;

            case "1060":       //其它应收款
                dalAccOtherReceivable dalorec = new dalAccOtherReceivable();
                BindingCollection <modOtherReceivableSummary> listorec = dalorec.GetOtherReceivableSummary(cboAccName.ComboBox.SelectedValue.ToString(), out Util.emsg);
                if (listorec != null && listorec.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listorec);
                    frm.ShowDialog();
                }
                break;

            case "1075":       //应收票据
                dalAccCheckList dalcheck = new dalAccCheckList();
                BindingCollection <modAccCheckList> listcheck = dalcheck.GetIList("0", string.Empty, mod.SubjectId, string.Empty, string.Empty, string.Empty, out Util.emsg);
                frm = new frmViewList();
                frm.InitViewList(mod.SubjectName, listcheck);
                frm.ShowDialog();
                break;

            case "1235":       //库存商品
                dalAccProductInout dalio = new dalAccProductInout();
                BindingCollection <modAccProductSummary> listio = dalio.GetAccProductSummary(cboAccName.ComboBox.SelectedValue.ToString(), Util.IsTrialBalance, out Util.emsg);
                if (listio != null && listio.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listio);
                    frm.ShowDialog();
                }
                break;

            default:
                dalAccReport dalrpt = new dalAccReport();
                BindingCollection <modAccCredenceDetail> listrpt = new BindingCollection <modAccCredenceDetail>();
                dalrpt.GetCredenceDetail(true, cboAccName.ComboBox.SelectedValue.ToString(), mod.SubjectId, Util.IsTrialBalance, ref listrpt, out Util.emsg);
                if (listrpt != null && listrpt.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listrpt);
                    frm.ShowDialog();
                }
                else
                {
                    if (!string.IsNullOrEmpty(Util.emsg))
                    {
                        MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                break;
            }
        }