コード例 #1
0
        private void Delete(PfAccountRecord item)
        {
            DialogResult dialogResult = GlobalMessageBox.Show("确定删除该条数据?", "提示", MessageBoxButtons.OKCancel);

            if (dialogResult != DialogResult.OK)
            {
                return;
            }
            InteractResult result = GlobalCache.ServerProxy.DeletePfAccountRecord(item.AutoID);

            switch (result.ExeResult)
            {
            case ExeResult.Success:
                GlobalMessageBox.Show("删除成功!");
                DeleteSelectedHangedOrder(item);
                break;

            case ExeResult.Error:
                GlobalMessageBox.Show(result.Msg);
                break;

            default:
                break;
            }
        }
コード例 #2
0
 internal DialogResult ShowDialog(PfAccountRecord item, bool readOnly)
 {
     this.readOnly = readOnly;
     this.CurItem  = item;
     Display();
     return(this.ShowDialog());
 }
コード例 #3
0
        private void Edit(PfAccountRecord item)
        {
            WholesaleAccountSearchForm form = new WholesaleAccountSearchForm();

            if (form.ShowDialog(item, false) == DialogResult.OK)
            {
                RefreshPage();
            }
        }
コード例 #4
0
 private void DeleteSelectedHangedOrder(PfAccountRecord order)
 {
     try
     {
         List <PfAccountRecord> orders = (List <PfAccountRecord>) this.dataGridView1.DataSource;
         orders.Remove(order);
         dataGridViewPagingSumCtrl.BindingDataSource(orders);
     }
     catch { }
 }
コード例 #5
0
        private void BaseButton3_Click(object sender, EventArgs e)
        {
            try
            {
                if (pfCustomer == null)
                {
                    GlobalMessageBox.Show("客户不存在,请重新选择!");
                    skinComboBox_PfCustomer.Focus();
                    return;
                }
                if (textBoxAmount.Value == 0)
                {
                    GlobalMessageBox.Show("请输入回款金额!");
                    textBoxAmount.Focus();
                    return;
                }
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                PfAccountRecord record = new PfAccountRecord()
                {
                    PfCustomerID = pfCustomer.ID,
                    CreateTime   = dateTimePicker_End.Value,
                    AccountMoney = -textBoxAmount.Value
                };
                InsertResult result = GlobalCache.ServerProxy.InsertPfAccountRecord4Fx(record);

                switch (result)
                {
                case InsertResult.Success:
                    GlobalMessageBox.Show("录入成功!");
                    //清空dataGirdView1的绑定源
                    textBoxAmount.Text           = string.Empty;
                    skinComboBox_PfCustomer.Text = null;
                    break;

                case InsertResult.Error:
                    GlobalMessageBox.Show("内部错误!");
                    break;

                default:
                    break;
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
コード例 #6
0
 public DialogResult ShowDialog(PfAccountRecord record)
 {
     this.record = record;
     if (record.SourceOrderID.StartsWith("PF"))
     {
         this.Text = "批发发货单明细";
     }
     else if (record.SourceOrderID.StartsWith("PT"))
     {
         this.Text = "批发退货单明细";
     }
     return(ShowDialog());
 }
コード例 #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="RefundCostume"></param>
        /// <param name="times">打印次数</param>
        public void Print(PfAccountRecord suplierRecord, int times)
        {
            this.suplierRecord = suplierRecord;
            // InteractResult<PfAccountRecord> result = CommonGlobalCache.ServerProxy.GetPrintTemplateInfo(PrintTemplateType.Retail);
            // if (result.ExeResult == ExeResult.Success)
            //  {
            //   PrintTemplateInfo PTemplateInfo = result.Data;
            // this.CurrentPTemplate = PTemplateInfo;
            PrintHelper printer = new PrintHelper(RefundCostume_PrintPage2);

            printer.printDocument.DefaultPageSettings.Margins   = new Margins(1, 1, 5, 1);
            printer.printDocument.DefaultPageSettings.PaperSize = new PaperSize(suplierRecord.AutoID.ToString(), PrintHelper.GetInch(8), 600);
            printer.DirectlyPrint(1);
            //  }
        }
コード例 #8
0
        private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            try
            {
                if (e.ColumnIndex < 0 || e.RowIndex < 0)
                {
                    return;
                }
                DataGridView    view = sender as DataGridView;
                PfAccountRecord row  = view.Rows[e.RowIndex].DataBoundItem as PfAccountRecord;
                if (row != null)
                {
                    if (ColumnDelete.Index == e.ColumnIndex)
                    {
                        switch ((PfAccountType)row.AccountType)
                        {
                        case PfAccountType.Collection:
                        case PfAccountType.Other:
                            break;

                        default:
                            e.Value = null;
                            break;
                        }
                    }
                    else if (ColumnEdit.Index == e.ColumnIndex)
                    {
                        switch ((PfAccountType)row.AccountType)
                        {
                        case PfAccountType.Collection:
                        case PfAccountType.Other:
                            break;

                        default:
                            e.Value = null;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex) {
            }
        }
コード例 #9
0
        private void Search(PfAccountRecord record)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                skinLabelOrder.Text    = record.SourceOrderID;
                skinLabelOpreator.Text = record.AdminUserName;
                skinLabelSupplier.Text = record.PfCustomerName;
                List <PfOrderDetail> listPage = null;
                listPage = GlobalCache.ServerProxy.GetPfAccountRecordDetails(record.SourceOrderID);

                if (listPage != null)
                {
                    int     totalCount = 0;
                    decimal totalPrice = 0;
                    for (int i = 0; i < listPage.Count; i++)
                    {
                        totalCount += listPage[i].SumCount;
                        totalPrice += listPage[i].SumCost;
                    }
                    skinLabelCount.Text = totalCount.ToString();
                    skinLabelPrice.Text = totalPrice.ToString();
                    foreach (var item in listPage)
                    {
                        item.CostumeName = CommonGlobalCache.GetCostumeName(item.CostumeID);
                    }
                }

                this.dataGridViewPagingSumCtrl.BindingDataSource <PfOrderDetail>(DataGridViewUtil.ToDataTable(listPage));
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
コード例 #10
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            List <PfAccountRecord> list = (List <PfAccountRecord>) this.dataGridView1.DataSource;
            PfAccountRecord        item = (PfAccountRecord)list[e.RowIndex];

            if (e.ColumnIndex == sourceOrderIDDataGridViewTextBoxColumn.Index)
            {
                WholesaleAccountRecordOrderDetailForm form = new WholesaleAccountRecordOrderDetailForm();
                form.ShowDialog(item);
            }
        }
コード例 #11
0
        private void BaseButtonSaveAccount_Click(object sender, EventArgs e)
        {
            try
            {
                String supllier = ValidateUtil.CheckEmptyValue(this.skinComboBox_PfCustomer.SelectedValue);
                if (String.IsNullOrEmpty(supllier))
                {
                    skinComboBox_PfCustomer.Focus();
                    GlobalMessageBox.Show("请先选择客户!");
                    return;
                }
                if (numericTextBox1.Value == 0)
                {
                    numericTextBox1.Focus();
                    return;
                }
                if (numericTextBox1.Value > Convert.ToDecimal(99999999.99))
                {
                    numericTextBox1.Focus();
                    GlobalMessageBox.Show("金额不能大于99999999.99!");
                    return;
                }

                //if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                //{
                //    return;

                //}



                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                decimal money = this.numericTextBox1.Value;

                PfAccountRecord record = new PfAccountRecord()
                {
                    AccountMoney = money,
                    AccountType  = (byte)(PfAccountType)this.skinComboBoxSaveType.SelectedValue,
                    PfCustomerID = supllier,
                    AdminUserID  = GlobalCache.CurrentUserID,
                    Remarks      = this.skinTextBoxRemark.SkinTxt.Text,
                    PayType      = (byte)(PfAccountRecordType)this.skinComboBox1.SelectedValue, // skinRadioButtonOther.Checked? (byte)PfAccountRecordType.Other: (byte)PfAccountRecordType.Balance,
                    CreateTime   = dateTimePicker_Start.Value
                };
                if (CurItem != null)
                {
                    UpdatePfAccountRecordPara para = new UpdatePfAccountRecordPara()
                    {
                        ID            = CurItem.AutoID,
                        AccountMoney  = record.AccountMoney,
                        PfCustomerID  = record.PfCustomerID,
                        PfAccountType = (PfAccountType)record.AccountType,
                        CreateTime    = record.CreateTime,
                        Remarks       = record.Remarks,
                        PayType       = (PfAccountRecordType)this.skinComboBox1.SelectedValue,
                    };
                    InteractResult result = GlobalCache.ServerProxy.UpdatePfAccountRecord(para);

                    switch (result.ExeResult)
                    {
                    case ExeResult.Success:
                        GlobalMessageBox.Show("修改成功!");
                        // this.ReLoad();
                        this.DialogResult = DialogResult.OK;
                        break;

                    case ExeResult.Error:
                        GlobalMessageBox.Show(result.Msg);
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    InteractResult result = GlobalCache.ServerProxy.InsertPfAccountRecord(record);
                    switch (result.ExeResult)
                    {
                    case ExeResult.Success:
                        GlobalMessageBox.Show("登记成功!");
                        //PfCustomerCache.Load();
                        //skinComboBox_PfCustomer.Initialize(true, true);
                        //this.ReLoad();
                        this.DialogResult = DialogResult.OK;
                        break;

                    case ExeResult.Error:
                        GlobalMessageBox.Show(result.Msg);
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                numericTextBox1.SkinTxt.Text        = string.Empty;
                this.skinTextBoxRemark.SkinTxt.Text = string.Empty;
                GlobalUtil.UnLockPage(this);
            }
        }
コード例 #12
0
        private void Print(PfAccountRecord item)
        {
            SalePayPrintUtil payPrint = new SalePayPrintUtil();

            payPrint.Print(item, 1);
        }
コード例 #13
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                List <PfAccountRecord> list = (List <PfAccountRecord>) this.dataGridView1.DataSource;
                PfAccountRecord        item = (PfAccountRecord)list[e.RowIndex];
                if (e.ColumnIndex == sourceOrderIDDataGridViewTextBoxColumn.Index)
                {
                    if ((AccountType)item.AccountType == AccountType.PurchaseCollection || (AccountType)item.AccountType == AccountType.Other)
                    {
                        //WholesaleAccountSearchForm form = new WholesaleAccountSearchForm();
                        //if (form.ShowDialog(item, true) == DialogResult.OK)
                        //{
                        //    RefreshPage();
                        //}
                        WholesaleAccountRecordOrderDetailForm form = new WholesaleAccountRecordOrderDetailForm();
                        form.ShowDialog(item);
                    }
                    else
                    {
                        WholesaleAccountSearchForm form = new WholesaleAccountSearchForm();
                        if (form.ShowDialog(item, true) == DialogResult.OK)
                        {
                            RefreshPage();
                        }
                        //WholesaleAccountRecordOrderDetailForm form = new WholesaleAccountRecordOrderDetailForm();
                        //form.ShowDialog(item);
                    }
                    //402 在“客户往来账明细”窗口内,增加点击单据 弹出单据明细窗口 功能。
                    //   this.skinSplitContainer1.Panel2Collapsed = false;
                    //  this.SourceOrderDetailClick?.Invoke(item.SourceOrderID, this, this.skinSplitContainer1.Panel2);
                }
                else if (e.ColumnIndex == ColumnDelete.Index)
                {
                    Delete(item);
                }
                else if (e.ColumnIndex == ColumnEdit.Index)
                {
                    Edit(item);
                }
                else if (e.ColumnIndex == Column2.Index)
                {
                    Print(item);
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }