Exemplo n.º 1
0
        private void b_ok_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(glookup_lcg.EditValue.ToString()))
            {
                glookup_lcg.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                glookup_lcg.ErrorText = "请先选择一个冷藏柜!";
                return;
            }
            if (dateEdit_so005.EditValue == null || string.IsNullOrEmpty(dateEdit_so005.EditValue.ToString()))
            {
                dateEdit_so005.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                dateEdit_so005.ErrorText = "请输入开始存放时间!";
                return;
            }
            if (string.IsNullOrEmpty(txtedit_nums.Text))
            {
                txtedit_nums.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                txtedit_nums.ErrorText = "请输入存放天数!";
                return;
            }
            decimal nums = decimal.Parse(txtedit_nums.Text);

            if ((nums - Math.Floor(nums)) > 0 && (nums - Math.Floor(nums)) != new decimal(0.5))
            {
                txtedit_nums.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                txtedit_nums.ErrorText = "存放天数只能为整数或者半日!";
                return;
            }

            string   s_si001 = glookup_lcg.EditValue.ToString();   //冷餐柜编号
            DateTime so005   = (DateTime)dateEdit_so005.EditValue; //开始存放日期

            if (SALESTYPE == "0")                                  //火化业务
            {
                int result = FireAction.FireSales_02(AC001,
                                                     s_si001,
                                                     nums,
                                                     so005,
                                                     Envior.cur_userId
                                                     );
                if (result > 0)
                {
                    DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            else if (SALESTYPE == "1")              //临时销售
            {
                DialogResult            = DialogResult.OK;
                this.swapdata["ITEMID"] = s_si001;
                this.swapdata["NUMS"]   = nums;
                this.Close();
            }
        }