Exemplo n.º 1
0
        private void sb_ok_Click(object sender, EventArgs e)
        {
            decimal price, nums;

            if (txtedit_price.EditValue == null || txtedit_price.EditValue is System.DBNull)
            {
                txtedit_price.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                txtedit_price.ErrorText = "请输入单价!";
                return;
            }
            if (txtedit_nums.EditValue == null || txtedit_nums.EditValue is System.DBNull)
            {
                txtedit_nums.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                txtedit_nums.ErrorText = "请输入数量!";
                return;
            }
            price = decimal.Parse(txtedit_price.Text);
            nums  = decimal.Parse(txtedit_nums.Text);

            if (sa01.SA005 == "0")              //火化业务
            {
                int result = FireAction.FireSalesEdit(sa01.SA001,
                                                      price,
                                                      nums,
                                                      Envior.cur_user.UC001
                                                      );
                if (result > 0)
                {
                    DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            else if (sa01.SA005 == "1")             //临时性销售
            {
                this.DialogResult = DialogResult.OK;
                sa01.PRICE        = price;
                sa01.NUMS         = nums;
                sa01.SA007        = price * nums;
                this.Close();
            }
        }
Exemplo n.º 2
0
        private void sb_ok_Click(object sender, EventArgs e)
        {
            decimal price, nums;

            if (txtedit_price.EditValue == null || txtedit_price.EditValue is System.DBNull)
            {
                txtedit_price.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                txtedit_price.ErrorText = "请输入单价!";
                return;
            }
            if (txtedit_nums.EditValue == null || txtedit_nums.EditValue is System.DBNull)
            {
                txtedit_nums.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                txtedit_nums.ErrorText = "请输入数量!";
                return;
            }
            price = decimal.Parse(txtedit_price.Text);
            nums  = decimal.Parse(txtedit_nums.Text);

            if (dr["SA005"].ToString() == "0")  //火化业务
            {
                int result = FireAction.FireSalesEdit(dr["SA001"].ToString(),
                                                      price,
                                                      nums,
                                                      Envior.cur_userId
                                                      );
                if (result > 0)
                {
                    DialogResult = DialogResult.OK;
                    this.Dispose();
                }
            }
            else if (dr["SA005"].ToString() == "1") //临时性销售
            {
                dr["PRICE"] = price;
                dr["NUMS"]  = nums;
                dr["SA007"] = price * nums;
                this.Dispose();
            }
        }