Пример #1
0
        private void leijiQty_2_load()
        {
            UserDao dao = new UserDao();
            //if (this.cmb_no_fahuolou.SelectedValue == null)
            //{
            //    return;
            //}
            if (this.dgv_1.CurrentCell == null)
            {
                return;
            }
            //刷新累计车次和累计方量
            //已发货单数量 = qty_send-qty_baofei-qty_back,用于发货数量的控制判断
            //sumQty = db.GetScalar_d("select sum(qty_send)-sum(qty_back)-sum(qty_baofei)-sum(qty_zy) from ls_send where no_productorder ='" + this.dgv_1.CurrentRow.Cells["no_productorder"].Value.ToString().Trim() + "' and no_fahuolou='" + BLL.string_1(this.cmb_no_fahuolou.SelectedValue) + "' and date_bill between '" + DateTime.Now.ToShortDateString() + "' and '" + DateTime.Now.ToShortDateString() + " 23:59:59'");
            sumQty = dao.GetScalar_d("select sum(qty_send)-sum(qty_back)-sum(qty_baofei)-sum(qty_zy) from ls_send where no_productorder ='" + this.dgv_1.CurrentRow.Cells["no_productorder"].Value.ToString().Trim() + "'");
            this.txt_qty_leiji.Text = sumQty.ToString();
            //this_edit.ds.Tables["head"].Rows[0]["qty_leiji"] = sumQty.ToString();

            //sumQty2 = db.GetScalar_d("select sum(qty_send) from ls_send where no_productorder ='" + this.dgv_1.CurrentRow.Cells["no_productorder"].Value.ToString().Trim() + "' and no_fahuolou='" + BLL.string_1(this.cmb_no_fahuolou.SelectedValue) + "'");
            sumQty2 = dao.GetScalar_d("select sum(qty_send) from ls_send where no_productorder ='" + this.dgv_1.CurrentRow.Cells["no_productorder"].Value.ToString().Trim() + "'");
            this.txt_qty_send_total.Text = sumQty2.ToString();
            //this_edit.ds.Tables["head"].Rows[0]["qty_send_total"] = sumQty2.ToString();

            //累计发货车次
            //int checi = db.GetScalar("select count(*) from ls_send where no_productorder='" + this.dgv_1.CurrentRow.Cells["no_productorder"].Value.ToString().Trim() + "' and no_fahuolou='" + BLL.string_1(this.cmb_no_fahuolou.SelectedValue) + "' and date_bill between '" + DateTime.Now.ToShortDateString() + "' and '" + DateTime.Now.ToShortDateString() + " 23:59:59'") + 1;
            int checi = Convert.ToInt32(dao.GetScalar_d("select count(*) from ls_send where no_productorder='" + this.dgv_1.CurrentRow.Cells["no_productorder"].Value.ToString().Trim() + "'")) + 1;
            this.txt_checi.Text = checi.ToString();
            //this_edit.ds.Tables["head"].Rows[0]["checi"] = checi.ToString();
        }
Пример #2
0
        private void leijiQty_pd()
        {
            UserDao dao = new UserDao();
            string sql = String.Format("select no_send_control from ls_hetong where no_bill='{0}'", txt_no_hetong.Text.Trim());

            //判断选中的合同发货控制类型(01先款后货  02其他)
            if (dao.GetScalar_s(sql) == "01")
            {
                leijiQty_2 = dao.GetScalar_d("select sum(qty_send)-sum(qty_back)-sum(qty_baofei)-sum(qty_zy) from ls_send where no_productorder ='" + this.dgv_1.CurrentRow.Cells["no_productorder"].Value.ToString().Trim() + "'");
                if (leijiQty_2 >= yudingQty)
                {
                    MessageBox.Show("发货数量已经超出预定数量,不允许发货");
                    this.is_ok = false;
                }
            }
            if (this.is_ok)
            {
            }
            else
            {
                this.btn_save2.Enabled = false;
            }
            this.is_ok = true;
        }
Пример #3
0
        private bool car_max()
        {
            UserDao dao = new UserDao();
            decimal car_max = dao.GetScalar_d(string.Format("select car_max_fangliang from ls_system_init"));
            decimal qty_send = BLL.decimal_1(txt_qty_send.Text);

            if (qty_send > car_max)
            {
                MessageBox.Show("单车发货量大于单车最大方量");
                return false;
            }
            return true;
        }