Esempio n. 1
0
        private void Payment(DistributorWithdrawRecord item)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                InteractResult result = GlobalCache.ServerProxy.PayDistributorWithdrawRecord(item.AutoID);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show("付款成功!");
                    RefreshPage();
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Esempio n. 2
0
        public PaymentCashForm(DistributorWithdrawRecord item)
        {
            InitializeComponent();
            SetUpCos();
            String savePath = GlobalUtil.EmallDir + Path.GetFileName(item.PaymentCdeUrl);
            //item.LinkAddress.Substring(item.LinkAddress.LastIndexOf());
            //引用前必须释放所有图片文件的使用权
            Image img = null;

            try
            {
                if (!File.Exists(savePath))
                {
                    CosCloud.DownloadFile(CosLoginInfo.BucketName, item.PaymentCdeUrl, savePath);
                }
                img = JGNet.Core.ImageHelper.FromFileStream(savePath);
            }
            catch (Exception ex)
            {
                //下载失败,可能文件被占用,直接使用该文件即可。
                //文件找不到使用默认图片,找不到
            }

            img = JGNet.Core.ImageHelper.GetNewSizeImage(img, 160);

            this.pictureBox1.Image = img;
        }
Esempio n. 3
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e)) { return; }
     try
     {
         if (e.RowIndex > -1 && e.ColumnIndex > -1)
         {
             /*   if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }*/
                List<DistributorWithdrawRecord> list = (List<DistributorWithdrawRecord>)this.dataGridView1.DataSource;
                DistributorWithdrawRecord item = (DistributorWithdrawRecord)list[e.RowIndex];
               if (e.ColumnIndex == Column1.Index)
                {
                 AddPaymentForm form = new AddPaymentForm(item);
                 // form.PfCustomerRechargeRecordSuccess += WholesaleCustomerRechargeForm_PfCustomerRechargeRecordSuccess;
                 if (form.ShowDialog(this.FindForm()) == DialogResult.OK)
                 {
                     this.RefreshPage();
                 }
             }  /**/
             /*      List<PfCustomer> list = (List<PfCustomer>)this.dataGridView1.DataSource;
                   PfCustomer item = (PfCustomer)list[e.RowIndex];
                   switch (this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)
                   {
                       case "余额明细":
                         this.BalanceDetailClick?.Invoke(item, this);
                           break;
                       case "编辑":
                           this.SaveClick(item, this);
                           break;
                       case "删除":
                           if (GlobalMessageBox.Show("删除之后将查不到该客户的往来账,确定删除吗?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                           {
                               Remove(list, item);
                           }
                           break;
                   }*/
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
     finally
     {
         GlobalUtil.UnLockPage(this);
     }
 }
Esempio n. 4
0
        private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            DistributorWithdrawRecord item = dataGridView1.Rows[e.RowIndex].DataBoundItem as DistributorWithdrawRecord;

            if (item.State != 0)
            {
                if (ColumnPay.Index == e.ColumnIndex)
                {
                    e.Value = string.Empty;
                }
                else if (ColumnCancel.Index == e.ColumnIndex)
                {
                    e.Value = string.Empty;
                }
            }
        }
Esempio n. 5
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            try
            {
                List <DistributorWithdrawRecord> curScrapOrderListSource = (List <DistributorWithdrawRecord>) this.dataGridView1.DataSource;

                DistributorWithdrawRecord item = curScrapOrderListSource[e.RowIndex];

                if (ColumnPay.Index == e.ColumnIndex)
                {
                    PaymentCashForm payform = new PaymentCashForm(item);

                    if (payform.ShowDialog(this) == DialogResult.OK)
                    {
                        Payment(item);
                    }
                    //  payform.ConfirmClick += Payment(item);

                    // Payment(item);
                    //this.skinSplitContainer1.Panel2Collapsed = false;
                    //this.DetailClick?.Invoke(item, this.skinSplitContainer1.Panel2, false);
                }
                else if (ColumnCancel.Index == e.ColumnIndex)
                {
                    Cancel(item);
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.WriteLog(ex);
            }
        }
Esempio n. 6
0
        private void Cancel(DistributorWithdrawRecord item)
        {
            try
            {
                if (GlobalMessageBox.Show("确定取消提现申请吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                InteractResult result = GlobalCache.ServerProxy.CancelDistributorWithdrawRecord(item.AutoID);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show("取消成功!");
                    RefreshPage();
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Esempio n. 7
0
        private void BaseButtonSaveAccount_Click(object sender, EventArgs e)
        {
            try
            {
                if (pfCustomerIDTextBox1.SkinTxt.Text == "")
                {
                    GlobalMessageBox.Show("请先选择分销人员!");
                    return;
                }
                else
                {
                    //判断分销人员存不存在
                    string pfCustomerID = pfCustomerIDTextBox1.SkinTxt.Text;
                    InteractResult <PfCustomer> pfItemInfo = CommonGlobalCache.ServerProxy.GetPfCustomer(pfCustomerID);
                    decimal pfMoney = numericTextBox1.Value;
                    if (pfItemInfo.ExeResult == ExeResult.Success)
                    {
                        if (pfItemInfo.Data == null)
                        {
                            GlobalMessageBox.Show("请选择正确的分销人员!");

                            return;
                        }
                        else
                        {
                            if (numericTextBox2.Value == 0)
                            {
                                numericTextBox2.Value = pfItemInfo.Data.RemainingCommission;
                            }
                        }
                    }
                }
                if (numericTextBox1.Value <= 0)
                {
                    numericTextBox1.Focus();
                    GlobalMessageBox.Show("打款金额必须大于0!");
                    return;
                }
                else
                {
                    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;


                DistributorWithdrawRecord para = new DistributorWithdrawRecord()
                {
                    DistributorID = pfCustomerIDTextBox1.SkinTxt.Text,
                    Money         = money,
                    Remarks       = textBoxRemark.SkinTxt.Text,
                    //DistributorName
                    CreateTime = dateTimePicker_Start.Value,
                };
                InteractResult result = GlobalCache.ServerProxy.PayCommission(para);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show("新增成功!");
                    // this.ReLoad();
                    numericTextBox1.SkinTxt.Text = string.Empty;
                    this.DialogResult            = DialogResult.OK;
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Esempio n. 8
0
 public AddPaymentForm(DistributorWithdrawRecord disRecord = null)
 {
     InitializeComponent();
     CurDistributorInfo = disRecord;
     this.Initialize();
 }
Esempio n. 9
0
        private void baseButton1_Click(object sender, EventArgs e)
        {
            try {
                if (numericTextBox1.Value <= 0)
                {
                    numericTextBox1.Focus();
                    GlobalMessageBox.Show("打款金额必须大于0!");
                    return;
                }
                else
                {
                    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;
                string  remark = this.textBoxRemark.SkinTxt.Text;
                DistributorWithdrawRecord para = new DistributorWithdrawRecord()
                {
                    DistributorID = pfCustomerIDTextBox1.SkinTxt.Text,
                    Money         = money,

                    //DistributorName
                    CreateTime = dateTimePicker_Start.Value,
                };

                InteractResult result = GlobalCache.ServerProxy.UpdateDistributorWithdrawRecord(CurDistributorInfo.AutoID, money, dateTimePicker_Start.Value, remark);
                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;
                }
                // }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                numericTextBox1.SkinTxt.Text = string.Empty;
                //  this.skinTextBoxRemark.SkinTxt.Text = string.Empty;
                GlobalUtil.UnLockPage(this);
            }
        }