private void btnTO_Click(object sender, EventArgs e)
 {
     string did = this.q_DID.Text.Trim();
     if (did == string.Empty)
     {
         MessageBoxEx.Show("请输入请购单号后在执行抛单!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         this.q_DID.Focus();
         return;
     }
     HY_BLL.HY_RequisitionInfoBLL hyrepinfobll = new HY_RequisitionInfoBLL();
     did = did.Replace("QG", "CG");
     string fsq0 = "select r_DID,r_Supplier,r_State from HY_RequisitionInfo where r_DID='" + this.q_DID.Text.Trim() + "'";
     string fsql = "select c_DID from HY_ProcurementInfo where c_DID='" + did + "'";
     DataTable fh = hyrepinfobll.ExecuteQuery(fsq0);
     DataTable f = hyrepinfobll.ExecuteQuery(fsql);
     if (fh.Rows.Count > 0)
     {
         if (fh.Rows[0][1].ToString() == string.Empty)
         {
             MessageBoxEx.Show("此请购单供应商等信息没有添加,请添加后抛单!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.q_DID.Text = "";
             return;
         }
         if (fh.Rows[0][2].ToString() == "确认中")
         {
             MessageBoxEx.Show("此请购单等待确认中,确认后方可操作!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.q_DID.Text = "";
             return;
         }
     }
     if (f.Rows.Count > 0)
     {
         MessageBoxEx.Show("此请购单已抛转成采购单无需重复抛单!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         this.q_DID.Text = "";
     }
     else
     {
         string sql = "insert into HY_ProcurementInfo(c_DID,c_CID,c_Department,c_Person,c_Name,c_NameID,c_Supplier,c_Origin,c_QDate,c_XDate,c_Specifications,c_Units,c_Uses,c_Notes,c_Hot,c_Amount,c_ModClass) select REPLACE(r_DID,'QG','CG'),r_CID,r_Department,r_Person,r_Name,r_NameID,r_Supplier,r_Origin,r_QDate,r_XDate,r_Specifications,r_Units,r_Uses,r_Notes,r_Hot,r_Amount,r_ModClass from HY_RequisitionInfo WHERE r_DID='" + this.q_DID.Text.Trim() + "'";
         int res = hyrepinfobll.com_ExecuteQuery(sql);
         if (res > 0)
         {
             MessageBoxEx.Show("恭喜:请购单抛转采购单成功!", "提示", MessageBoxButtons.OK);
             this.Close();
         }
     }
 }
Esempio n. 2
0
        //自定义绑定数据
        private void requistionDate(string sql)
        {
            HY_BLL.HY_RequisitionInfoBLL hyul = new HY_RequisitionInfoBLL();
            this.listView1.View = View.Details;
            this.listView1.FullRowSelect = true;
            SqlDataReader sdr = hyul.f_RequisitionInfo(sql);
            while (sdr.Read())
            {
                ListViewItem lv = new ListViewItem(sdr[0].ToString());
                lv.SubItems.Add(sdr[2].ToString());
                if (sdr[1].ToString() == "已确认")
                {
                    lv.ImageIndex = 0;
                }
                else
                {
                    lv.ImageIndex = 1;
                }

                this.listView1.Items.Add(lv);
            }
        }
        private void btnTO_Click(object sender, EventArgs e)
        {
            string did = this.b_BID.Text.Trim();
            if (did == string.Empty)
            {
                MessageBoxEx.Show("请输入物料单号!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.b_BID.Focus();
                return;
            }
            did = did.Replace("B", "QG");
            HY_BLL.HY_BomDetailsBLL hybom = new HY_BomDetailsBLL();
            string sql = "select b_HDate from HY_BomInfo where b_SKID='" + did + "'";
            SqlDataReader sdr = hybom.f_SQLBom(sql);
            while (sdr.Read())
            {
                if (sdr[0].ToString() == string.Empty)
                {
                    MessageBoxEx.Show("此物料单还未审核,请部门经理审核后再抛单", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            HY_BLL.HY_RequisitionInfoBLL hyrepinfobll = new HY_RequisitionInfoBLL();
            string fsql = "select * from HY_RequisitionInfo where r_DID='" + did + "'";
            DataTable f = hyrepinfobll.ExecuteQuery(fsql);
            if (f.Rows.Count > 0)
            {
                MessageBox.Show("此请购单已抛转成采购单无需重复抛单!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.b_BID.Text = "";
            }
            else
            {
                string sql2 = "insert into HY_RequisitionInfo(r_DID,r_CID,r_NameID,r_Name,r_Person,r_Origin,r_Specifications,r_Amount,r_Hot,r_Notes,r_QDate,r_ModClass) select REPLACE(d_SKID,'B','QG'),d_CID,d_PID,d_PName,d_SPerson,d_Model,d_Specifications,d_Amount,d_Heat,d_Notes,'" + DateTime.Now + "',d_ModClass from HY_BomDetails WHERE d_SKID='" + this.b_BID.Text.Trim() + "'";
                int res = hyrepinfobll.com_ExecuteQuery(sql2);
                if (res > 0)
                {
                    MessageBox.Show("恭喜:请购单抛转采购单成功!", "提示", MessageBoxButtons.OK);
                }
            }
        }
Esempio n. 4
0
 public HY_Purchasingstatus()
 {
     InitializeComponent();
     hyrepinfobll = new HY_RequisitionInfoBLL();
 }
 //构造函数
 public HY_Requisitions()
 {
     InitializeComponent();
     hyrepinfobll = new HY_RequisitionInfoBLL();
     valid        = new HYWJ.HY_System.OperateAndValidate();
 }
 private void listView1_Click(object sender, EventArgs e)
 {
     GetMainvalue = this.listView1.SelectedItems[0].SubItems[0].Text;//窗口传值将变量赋值给方法
     string str_DID = this.listView1.SelectedItems[0].SubItems[0].Text;
     this.groupPanel2.Text = str_DID + "采购单产品列表";
     this.dataGridViewCGMX.AutoGenerateColumns = false;// 关闭自动创建列
     HY_BLL.HY_RequisitionInfoBLL hyrepinfobll = new HY_RequisitionInfoBLL();
     string sql = "select * from HY_ProcurementInfo where c_DID='" + str_DID + "'";
     this.dataGridViewCGMX.DataSource = hyrepinfobll.ExecuteQuery(sql);
 }
        private string supplier; //传给子窗体的值供应商

        #endregion Fields

        #region Constructors

        public HY_Purchasingstatus()
        {
            InitializeComponent();
            hyrepinfobll = new HY_RequisitionInfoBLL();
        }
Esempio n. 8
0
 public HY_RequisitionsWH()
 {
     InitializeComponent();
     hyrepinfobll = new HY_RequisitionInfoBLL();
 }
 public HY_RequisitionsWH()
 {
     InitializeComponent();
     hyrepinfobll = new HY_RequisitionInfoBLL();
 }
Esempio n. 10
0
        private LL.Main.HY_System.OperateAndValidate valid; //实例化数据验证类

        #endregion Fields

        #region Constructors

        //构造函数
        public HY_Requisitions()
        {
            InitializeComponent();
            hyrepinfobll = new HY_RequisitionInfoBLL();
            valid = new LL.Main.HY_System.OperateAndValidate();
        }