예제 #1
0
        private void btn发布_Click(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    gridView1.FocusedRowHandle -= 1;
                    gridView1.FocusedRowHandle += 1;
                }
                catch { }

                if (txt发布人.Text.Trim() != "")
                {
                    MessageBox.Show("已经发布");
                    return;
                }

                btn保存_Click(null, null);
                string sSQL = "update UFDLImport..杜乐公告 set 发布人 = '" + FrameBaseFunction.ClsBaseDataInfo.sUid + "',发布日期 = '" + DateTime.Today.ToString("yyyy-MM-dd") + "' where guid = '" + sGuid + "'";

                clsSQLCommond.ExecSql(sSQL);
                MessageBox.Show("发布成功");

                txt发布人.Text    = FrameBaseFunction.ClsBaseDataInfo.sUid;
                date_发布日期.Text = DateTime.Today.ToString("yyyy-MM-dd");
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }
예제 #2
0
        private void btn发布_Click(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    gridView2.FocusedRowHandle -= 1;
                    gridView2.FocusedRowHandle += 1;
                }
                catch { }

                sSave();

                string    sSQL = "select * from UFDLImport..询价单 where [GUID] = '" + sGuid + "'";
                DataTable dt   = clsSQLCommond.ExecQuery(sSQL);
                if (dt == null || dt.Rows.Count == 0)
                {
                    throw new Exception("获得询价单失败");
                }
                if (dt.Rows[0]["发布人"].ToString().Trim() != "")
                {
                    throw new Exception("已经发布");
                }

                sSQL = "update UFDLImport..询价单 set 发布人 = '" + FrameBaseFunction.ClsBaseDataInfo.sUid + "',发布日期 = '" + DateTime.Today.ToString("yyyy-MM-dd") + "' where guid = '" + sGuid + "'";

                clsSQLCommond.ExecSql(sSQL);
                MessageBox.Show("发布成功");

                try
                {
                    string[] s供应商 = label供应商.Text.Trim().Split(',');
                    for (int i = 0; i < s供应商.Length; i++)
                    {
                        sSQL = "select sEMail from UFDLImport.._vendUid where vendcode = '" + s供应商[i] + "' and isnull(sEMail,'') <> '' order by AccYear desc";
                        dt   = clsSQLCommond.ExecQuery(sSQL);
                        if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString().Trim() != "")
                        {
                            SendMail(dt.Rows[0][0].ToString().Trim(), "报价单", "询价单" + labeliID.Text + "已经发布请尽快报价");
                        }
                    }
                }
                catch { }

                this.Close();
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }
예제 #3
0
        private void btn撤销_Click(object sender, EventArgs e)
        {
            try
            {
                string sSQL = @"
select * 
from UFDLImport..询价单供应商报价 
where 供应商编码 = '@供应商编码' and GUID = '@GUID'
";
                sSQL = sSQL.Replace("@供应商编码", lookUpEditcVenCode.EditValue.ToString().Trim());
                sSQL = sSQL.Replace("@GUID", sGuid);
                DataTable dt = clsSQLCommond.ExecQuery(sSQL);
                if (dt == null || dt.Rows.Count == 0)
                {
                    throw new Exception("询价单失败");
                }
                if (dt.Rows.Count > 0)
                {
                    string s审批人 = dt.Rows[0]["审批人"].ToString().Trim();
                    if (s审批人 != "")
                    {
                        throw new Exception("已经审批不能撤销");
                    }
                }

                sSQL = @"
	delete UFDLImport..询价单供应商报价 
	where 供应商编码 = '@供应商编码' and GUID = '@GUID'
";
                sSQL = sSQL.Replace("@供应商编码", lookUpEditcVenCode.EditValue.ToString().Trim());
                sSQL = sSQL.Replace("@GUID", sGuid);
                clsSQLCommond.ExecSql(sSQL);
                MessageBox.Show("撤销成功");

                this.Close();
            }
            catch (Exception ee)
            {
                MessageBox.Show("撤销提交:" + ee.Message);
            }
        }