Example #1
0
        private void Frm_RegisterPay_Load(object sender, EventArgs e)
        {
            s_rc001 = this.swapdata["rc001"].ToString();
            RC01 rc01 = unitOfWork1.GetObjectByKey <RC01>(s_rc001);

            if (rc01 != null)
            {
                txtEdit_rc001.EditValue = rc01.RC001;
                txtEdit_rc109.EditValue = rc01.RC109;                                      //寄存证号
                be_position.Text        = RegAction.GetRegPosition(s_rc001);               //寄存位置

                bitprice = RegAction.GetRegPrice(s_rc001);                                 //寄存单价
                txtedit_price.EditValue = bitprice;
                txtEdit_rc003.EditValue = rc01.RC003;
                rg_rc002.EditValue      = rc01.RC002;
                txtEdit_rc004.EditValue = rc01.RC004;
                txtEdit_rc303.EditValue = rc01.RC303;
                rg_rc202.EditValue      = rc01.RC202;
                txtEdit_rc404.EditValue = rc01.RC404;

                op_rc001.Value = s_rc001;
                rc04Adapter.Fill(dt_rc04);
                gridControl1.DataSource = dt_rc04;

                comboBox1.Text = "";
            }
            else
            {
                sb_ok.Enabled = false;
                XtraMessageBox.Show("数据未找到!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void Frm_RegOut_Load(object sender, EventArgs e)
        {
            s_rc001 = this.swapdata["rc001"].ToString();
            RC01 rc01 = unitOfWork1.GetObjectByKey <RC01>(s_rc001);

            if (rc01 != null)
            {
                txtEdit_rc001.Text      = rc01.RC001;
                txtEdit_rc109.Text      = rc01.RC109;                        //寄存证号
                be_position.Text        = RegAction.GetRegPosition(s_rc001); //寄存位置
                txtEdit_rc003.Text      = rc01.RC003;
                txtEdit_rc303.EditValue = rc01.RC303;
                rg_rc002.EditValue      = rc01.RC002;
                rg_rc202.EditValue      = rc01.RC202;
                txtEdit_rc004.EditValue = rc01.RC004;
                txtEdit_rc404.EditValue = rc01.RC404;
                //寄存号位单价
                price = RegAction.GetRegPrice(s_rc001);
                txtEdit_price.EditValue = price;
                txtEdit_rc150.EditValue = rc01.RC150;                      //寄存到期时间

                int diff    = RegAction.CalcOutDiffDays(s_rc001);
                int compare = string.Compare(rc01.RC150.ToString("yyyyMMdd"), MiscAction.GetServerTime().ToString("yyyyMMdd"));
                if (compare == 0)
                {
                    checkEdit1.Enabled   = false;
                    txtEdit_nums.Enabled = false;
                }
                else if (compare > 0)                  //退费
                {
                    lc_1.Text = "剩余天数";
                    lc_2.Text = "应退费月数";
                    lc_3.Text = "退费金额";
                    isrefund  = true;

                    //txtEdit_nums.EditValue = Math.Round((diff * 1.0f) / 30, 0);
                    //txtEdit_fee.EditValue = Convert.ToDecimal(Math.Round((diff * 1.0f) / 30, 0)) * price;
                    txtEdit_nums.EditValue = 0;
                    txtEdit_fee.EditValue  = 0;
                }
                else
                {
                    lc_1.Text = "过期天数";
                    lc_2.Text = "应补费月数";
                    lc_3.Text = "补费金额";

                    txtEdit_nums.EditValue = Math.Round((diff * 1.0f) / 30, 0);
                    txtEdit_fee.EditValue  = Convert.ToDecimal(Math.Round((diff * 1.0f) / 30, 0)) * price;
                }
                txtEdit_diff.EditValue = diff;
            }
            else
            {
                sb_ok.Enabled = false;
                XtraMessageBox.Show("数据未找到!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }