public DataTable Get供应商存货价格(string sVenCode, string sInvCode) { sSQL = sSQL.Replace("1=1", "1=1 and cVenCode = '" + sVenCode + "' "); sSQL = sSQL.Replace("1=1", "1=1 and cInvCode = '" + sInvCode + "' "); DataTable dt供应商存货价格 = clsSQLCommond.ExecQuery(sSQL); return(dt供应商存货价格); }
private void SetValue() { string sSQL = @" select cast(0 as bit) as 选择, cVenCode as 供应商编码,cVenName as 供应商名称 from @u8.Vendor where 1=1 order by cVenCode"; if (radio采购.Checked) { sSQL = sSQL.Replace("1=1", "1=1 and cVenDepart = '4'"); } if (radio委外.Checked) { sSQL = sSQL.Replace("1=1", "1=1 and cVenDepart = '905'"); } if (radio未设置.Checked) { sSQL = sSQL.Replace("1=1", "1=1 and isnull(cVenDepart,'') = ''"); } DataTable dt = clsSQLCommond.ExecQuery(sSQL); gridControl1.DataSource = dt; sSQL = @" select * from UFDLImport..杜乐公告 a inner join UFDLImport..杜乐公告明细 b on a.GUID = b.GUID where a.GUID = '111111' "; sSQL = sSQL.Replace("111111", sGuid); dt = clsSQLCommond.ExecQuery(sSQL); txt主题.Text = dt.Rows[0]["标题"].ToString().Trim(); richTextBox内容.Text = dt.Rows[0]["内容"].ToString().Trim(); txt制单人.Text = dt.Rows[0]["制单人"].ToString().Trim(); date制单日期.Text = dt.Rows[0]["制单日期"].ToString().Trim(); txt发布人.Text = dt.Rows[0]["发布人"].ToString().Trim(); date_发布日期.Text = dt.Rows[0]["发布日期"].ToString().Trim(); for (int i = 0; i < gridView1.RowCount; i++) { string s供应商编码 = gridView1.GetRowCellValue(i, gridCol供应商编码).ToString().Trim(); for (int j = 0; j < dt.Rows.Count; j++) { string s供应商编码2 = dt.Rows[j]["供应商编码"].ToString().Trim(); if (s供应商编码 == s供应商编码2) { gridView1.SetRowCellValue(i, gridCol选择, true); break; } } } }
private void Frm杜乐公告供应商查看Edit_Load(object sender, EventArgs e) { try { string sSQL = @" select * from UFDLImport..杜乐公告 a inner join UFDLImport..杜乐公告明细 b on a.GUID = b.GUID where a.GUID = '111111' and 供应商编码 = '222222' "; sSQL = sSQL.Replace("111111", sGuid); sSQL = sSQL.Replace("222222", sVenCode); DataTable dt = clsSQLCommond.ExecQuery(sSQL); txt阅读人.Text = dt.Rows[0]["阅读人"].ToString().Trim(); txt制单人.Text = dt.Rows[0]["制单人"].ToString().Trim(); txt主题.Text = dt.Rows[0]["标题"].ToString().Trim(); richTextBox内容.Text = dt.Rows[0]["内容"].ToString().Trim(); date阅读人.Text = dt.Rows[0]["阅读日期"].ToString().Trim(); date制单日期.Text = dt.Rows[0]["制单日期"].ToString().Trim(); } catch (Exception ee) { MessageBox.Show("加载窗体失败\n" + ee.Message); } }
private void LoadVenLists() { try { string sSQL = "select vendCode,cVenName from UFDLImport.._vendUid left join @u8.Vendor on @u8.Vendor.cVenCode = vendCode where uid = '" + FrameBaseFunction.ClsBaseDataInfo.sUid + "' and accid = 200 and accyear = " + FrameBaseFunction.ClsBaseDataInfo.sUFDataBaseName.Substring(11, 4) + " "; DataTable dt = clsSQLCommond.ExecQuery(sSQL); txtVenCode.Properties.ReadOnly = false; if (FrameBaseFunction.ClsBaseDataInfo.sUid == "admin" || dt.Rows.Count == 0) { txtVenCode.Enabled = true; } else { if (dt.Rows[0]["vendCode"].ToString().Trim() == string.Empty) { txtVenCode.Enabled = true; } else { txtVenCode.Enabled = false; } txtVenCode.Text = dt.Rows[0]["vendCode"].ToString().Trim(); txtVenCode_Leave(null, null); } GetOMBills(); } catch (Exception ee) { MessageBox.Show("加载窗体失败!\n\t原因:" + ee.Message); } }
private void radioButton1_CheckedChanged(object sender, EventArgs e) { if (radioButton1.Checked) { string sSQL = "select a.MoCode,b.SortSeq,b.SoCode,b.SoSeq,b.InvCode,e.cInvName,e.cInvStd,d.InvCode as cInvCode,c.AllocateId,b.Qty,b.QualifiedInQty, b.Qty - isnull(b.QualifiedInQty,0) as UnQualifiedInQty " + "from @u8.mom_order a inner join @u8.mom_orderdetail b on a.MoId = b.MoId inner join @u8.mom_moallocate c on b.MoDId = c.MoDId inner join @u8.bas_part d on c.ComponentId = d.PartId inner join @u8.Inventory e on e.cInvCode = b.InvCode " + "where d.InvCode = '" + sInvCode + "' and b.Status = 3 " + "order by a.MoCode"; DataTable dt = clsSQLCommond.ExecQuery(sSQL); gridControl1.DataSource = dt; } }
private void SetValue() { string sSQL = @" select cast(0 as bit) as 选择, * from UFDLImport..InventoryHC where 1=1 order by cInvCode"; sSQL = sSQL.Replace("1=1", "1=1 and cInvCode = '" + scInvCode + "'"); DataTable dt = clsSQLCommond.ExecQuery(sSQL); if (dt != null && dt.Rows.Count > 0) { txtcInvcode.Text = dt.Rows[0]["cInvCode"].ToString().Trim(); txtcInvName.Text = dt.Rows[0]["cInvName"].ToString().Trim(); txtcInvAbbName.Text = dt.Rows[0]["cInvAbbName"].ToString().Trim(); txtCreateUid.Text = dt.Rows[0]["CreateUid"].ToString().Trim(); txtcInvStd.Text = dt.Rows[0]["cInvStd"].ToString().Trim(); txtRemark1.Text = dt.Rows[0]["Remark1"].ToString().Trim(); lookUpEditcVenCode.EditValue = dt.Rows[0]["Remark2"]; txtRemark3.Text = dt.Rows[0]["Remark3"].ToString().Trim(); txtRemark4.Text = dt.Rows[0]["Remark4"].ToString().Trim(); txtRemark5.Text = dt.Rows[0]["Remark5"].ToString().Trim(); txtRemark6.Text = dt.Rows[0]["Remark6"].ToString().Trim(); txtRemark7.Text = dt.Rows[0]["Remark7"].ToString().Trim(); txtRemark8.Text = dt.Rows[0]["Remark8"].ToString().Trim(); txtUpdateUid.Text = dt.Rows[0]["UpdateUid"].ToString().Trim(); lookUpEditInvcodeClassHC.EditValue = dt.Rows[0]["cInvCCode"].ToString().Trim(); if (dt.Rows[0]["CreateDate"].ToString().Trim() != "") { dtmCreate.Text = dt.Rows[0]["CreateDate"].ToString().Trim(); } if (dt.Rows[0]["UpdateDate"].ToString().Trim() != "") { dtmUpdate.Text = dt.Rows[0]["UpdateDate"].ToString().Trim(); } } }
private void SetValue() { string sSQL = @" select cast(0 as bit) as 选择, * from UFDLImport..VendorHC where 1=1 order by cVenCode"; sSQL = sSQL.Replace("1=1", "1=1 and cVenCode = '" + sVenCode + "'"); DataTable dt = clsSQLCommond.ExecQuery(sSQL); if (dt != null && dt.Rows.Count > 0) { txtcVencode.Text = dt.Rows[0]["cVencode"].ToString().Trim(); txtcVenName.Text = dt.Rows[0]["cVenName"].ToString().Trim(); txtcVenAbbName.Text = dt.Rows[0]["cVenAbbName"].ToString().Trim(); txtAddress.Text = dt.Rows[0]["Address"].ToString().Trim(); txtCreateUid.Text = dt.Rows[0]["CreateUid"].ToString().Trim(); txtcVenPerson.Text = dt.Rows[0]["cVenPerson"].ToString().Trim(); txtcVenPhone.Text = dt.Rows[0]["cVenPhone"].ToString().Trim(); txtRemark1.Text = dt.Rows[0]["Remark1"].ToString().Trim(); txtRemark2.Text = dt.Rows[0]["Remark2"].ToString().Trim(); txtRemark3.Text = dt.Rows[0]["Remark3"].ToString().Trim(); txtRemark4.Text = dt.Rows[0]["Remark4"].ToString().Trim(); txtRemark5.Text = dt.Rows[0]["Remark5"].ToString().Trim(); txtRemark6.Text = dt.Rows[0]["Remark6"].ToString().Trim(); txtRemark7.Text = dt.Rows[0]["Remark7"].ToString().Trim(); txtRemark8.Text = dt.Rows[0]["Remark8"].ToString().Trim(); txtUpdateUid.Text = dt.Rows[0]["UpdateUid"].ToString().Trim(); if (dt.Rows[0]["CreateDate"].ToString().Trim() != "") { dtmCreate.Text = dt.Rows[0]["CreateDate"].ToString().Trim(); } if (dt.Rows[0]["UpdateDate"].ToString().Trim() != "") { dtmUpdate.Text = dt.Rows[0]["UpdateDate"].ToString().Trim(); } } }
private void btnSEL_Click(object sender, EventArgs e) { string sSQL = "select *,cast(null as varchar(50)) as 采购评审,cast(null as varchar(50)) as 锁定 from XWSystemDB_DL..订单评审运算1 where 帐套号 = '" + (FrameBaseFunction.ClsBaseDataInfo.sUFDataBaseName.Substring(7, 3)).Trim() + "' and isnull(审核人,'') <> '' and isnull(关闭人,'') = '' "; if (dtm单据日期1.Text.Trim() != "") { sSQL = sSQL + " and 制单日期 >= '" + dtm单据日期1.DateTime.ToString("yyyy-MM-dd") + "' "; } if (dtm单据日期2.Text.Trim() != "") { sSQL = sSQL + " and 制单日期 < '" + dtm单据日期2.DateTime.AddDays(1).ToString("yyyy-MM-dd") + "' "; } if (lookUpEdit销售订单号1.Text.Trim() != "") { sSQL = sSQL + " and 销售订单号 >= '" + lookUpEdit销售订单号1.EditValue + "' "; } if (lookUpEdit销售订单号2.Text.Trim() != "") { sSQL = sSQL + " and 销售订单号 <= '" + lookUpEdit销售订单号2.EditValue + "' "; } if (lookUpEdit外销订单号1.Text.Trim() != "") { sSQL = sSQL + " and 外销订单号 >= '" + lookUpEdit外销订单号1.EditValue + "' "; } if (lookUpEdit外销订单号2.Text.Trim() != "") { sSQL = sSQL + " and 外销订单号 <= '" + lookUpEdit外销订单号2.EditValue + "' "; } if (lookUpEdit客户订单号1.Text.Trim() != "") { sSQL = sSQL + " and 客户订单号 >= '" + lookUpEdit客户订单号1.EditValue + "' "; } if (lookUpEdit客户订单号2.Text.Trim() != "") { sSQL = sSQL + " and 客户订单号 <= '" + lookUpEdit客户订单号2.EditValue + "' "; } //if (radio未下达.Checked) //{ // sSQL = sSQL + " and isnull(下达人,'') = '' "; //} //if (radio已下达.Checked) //{ // sSQL = sSQL + " and isnull(下达人,'') <> '' "; //} //采购评审 if (iType == 1) { sSQL = sSQL + " and isnull(下达请购人,'') <> '' "; } //委外评审 if (iType == 2) { sSQL = sSQL + " and isnull(下达委外人,'') = '' "; } //生产评审 if (iType == 3) { sSQL = sSQL + " and isnull(下达生产人,'') = '' "; } //下达采购计划 if (iType == 11) { sSQL = sSQL + " and isnull(下达请购人,'') = '' "; } //下达委外计划 if (iType == 12) { sSQL = sSQL + " and isnull(维护审核人,'') <> '' "; } //下达生产计划 if (iType == 13) { sSQL = sSQL + " and isnull(维护审核人,'') <> '' "; } //订单评审维护 if (iType == 4) { sSQL = sSQL + " "; } if (radio未评审.Checked) { string s子件属性 = ""; if (iType == 1) { s子件属性 = "采购"; } if (iType == 2) { s子件属性 = "委外"; } if (iType == 2) { s子件属性 = "自制"; } sSQL = sSQL + " and 销售订单ID in (select 销售订单ID from XWSystemDB_DL..订单评审运算3 where 帐套号 = '" + (FrameBaseFunction.ClsBaseDataInfo.sUFDataBaseName.Substring(7, 3)).Trim() + "' and isnull(回签人,'') = '' and 子件属性 = '" + s子件属性 + "' and isnull(本次下单数量,0) <> 0) "; } sSQL = sSQL + " order by 销售订单号"; DataTable dt = clsSQLCommond.ExecQuery(sSQL); for (int i = dt.Rows.Count - 1; i >= 0; i--) { string s回签人 = ""; string s锁定人 = ""; string s销售订单ID = dt.Rows[i]["销售订单ID"].ToString().Trim(); sSQL = "select distinct 回签人,锁定人 from XWSystemDB_DL..订单评审运算3 where 子件属性 = '采购' and 帐套号 = '" + (FrameBaseFunction.ClsBaseDataInfo.sUFDataBaseName.Substring(7, 3)).Trim() + "' and 销售订单ID = " + dt.Rows[i]["销售订单ID"]; DataTable dtTemp = clsSQLCommond.ExecQuery(sSQL); for (int j = 0; j < dtTemp.Rows.Count; j++) { if (dtTemp.Rows[j]["回签人"].ToString().Trim() != "") { s回签人 = s回签人 + dtTemp.Rows[j]["回签人"].ToString().Trim(); } if (dtTemp.Rows[j]["锁定人"].ToString().Trim() != "") { s锁定人 = s锁定人 + dtTemp.Rows[j]["锁定人"].ToString().Trim(); } } dt.Rows[i]["采购评审"] = s回签人; dt.Rows[i]["锁定"] = s锁定人; } gridControl1.DataSource = dt; }
private void SetValue() { string sSQL = @" select a.* ,b.*,c.cVenName from UFDLImport..询价单 a inner join UFDLImport..询价单供应商 b on a.GUID = b.GUID left join @u8.Vendor c on b.供应商编码 = c.cVenCode where a.GUID = '111111' "; sSQL = sSQL.Replace("111111", sGuid); DataTable dt = clsSQLCommond.ExecQuery(sSQL); if (dt == null || dt.Rows.Count == 0) { SetNull(); return; } labeliID.Text = dt.Rows[0]["iID"].ToString().Trim(); string sVenCode = ""; string sVenName = ""; for (int i = 0; i < dt.Rows.Count; i++) { if (sVenCode == "") { sVenCode = dt.Rows[i]["供应商编码"].ToString().Trim(); sVenName = dt.Rows[i]["cVenName"].ToString().Trim(); } else { sVenCode = sVenCode + "," + dt.Rows[i]["供应商编码"].ToString().Trim(); sVenName = sVenName + "," + dt.Rows[i]["cVenName"].ToString().Trim(); } } label供应商.Text = sVenCode; txtVenCode.Text = sVenCode; txtVenName.Text = sVenName; sSQL = @" select a.*,b.附件名 as 下载附件 ,cast(null as varchar(200)) as 上传附件 from UFDLImport..询价单物料列表 a left join UFDLImport..询价单附件 b on a.GUID物料 = b.GUID物料 where 1=1 order by a.iID "; sSQL = sSQL.Replace("1=1", "1=1 and a.GUID = '" + sGuid + "'"); DataTable dt物料列表 = clsSQLCommond.ExecQuery(sSQL); gridControl2.DataSource = dt物料列表; txt主题.Text = dt.Rows[0]["标题"].ToString().Trim(); richTextBox备注.Text = dt.Rows[0]["备注"].ToString().Trim(); dtm截止.Text = Convert.ToDateTime(dt.Rows[0]["截止日期"]).ToString("yyyy-MM-dd"); lookUpEditTime.EditValue = Convert.ToDateTime(dt.Rows[0]["截止日期"]).ToString("HH:mm"); txt终止日期.Text = dt.Rows[0]["终止询价日期"].ToString().Trim(); dtm单据日期.DateTime = Convert.ToDateTime(dt.Rows[0]["单据日期"]); txt制单人.EditValue = dt.Rows[0]["制单人"].ToString().Trim(); date制单日期.Text = dt.Rows[0]["制单日期"].ToString().Trim(); txt发布人.EditValue = dt.Rows[0]["发布人"].ToString().Trim(); date_发布日期.Text = dt.Rows[0]["发布日期"].ToString().Trim(); if (txt发布人.Text.Trim() != "") { SetEnbale(true); } else { SetEnbale(false); } }
private void SetValue() { string sSQL = @" select * ,getdate() as 当前时间 from UFDLImport..询价单 a inner join UFDLImport..询价单供应商 b on a.GUID = b.GUID where a.GUID = '111111' and b.供应商编码 = '222222' "; sSQL = sSQL.Replace("111111", sGuid); sSQL = sSQL.Replace("222222", lookUpEditcVenCode.EditValue.ToString().Trim()); DataTable dt = clsSQLCommond.ExecQuery(sSQL); if (dt == null || dt.Rows.Count == 0) { SetNull(); return; } DateTime d截止时间 = Convert.ToDateTime(dt.Rows[0]["截止日期"]); DateTime d终止时间 = Convert.ToDateTime("2099-12-31"); if (dt.Rows[0]["终止询价日期"].ToString().Trim() != "") { d终止时间 = Convert.ToDateTime(dt.Rows[0]["终止询价日期"]); } DateTime d当前时间 = Convert.ToDateTime(dt.Rows[0]["当前时间"]); if (d当前时间 > d终止时间 || d当前时间 > d截止时间.AddHours(2)) { gridView2.OptionsBehavior.Editable = false; btn撤销.Enabled = false; btn提交.Enabled = false; } else { gridView2.OptionsBehavior.Editable = true; btn撤销.Enabled = true; btn提交.Enabled = true; } sSQL = @" select a.iID, a.[GUID], a.自定义物料, a.物料编码, a.数量 as 要求数量, a.送样周期 as 要求送样周期, a.备注1, a.备注2, a.备注3, a.GUID物料 , b.单价, b.供应商编码, b.提交人, b.提交时间, b.供应商备注 as 供应商备注,b.数量,b.送样周期 ,c.附件名 as 下载附件 ,b.审批人,b.审批日期,b.审批结论 from UFDLImport..询价单物料列表 a left join UFDLImport..询价单供应商报价 b on a.GUID物料 = b.GUID物料 and b.供应商编码 = '111111' left join UFDLImport..询价单附件 c on c.GUID物料 = a.GUID物料 where 1=1 order by a.iID "; sSQL = sSQL.Replace("111111", lookUpEditcVenCode.EditValue.ToString().Trim()); sSQL = sSQL.Replace("1=1", "1=1 and a.GUID = '" + sGuid + "'"); DataTable dt物料列表 = clsSQLCommond.ExecQuery(sSQL); gridControl2.DataSource = dt物料列表; txt主题.Text = dt.Rows[0]["标题"].ToString().Trim(); richTextBox备注.Text = dt.Rows[0]["备注"].ToString().Trim(); dtm截止.Text = Convert.ToDateTime(dt.Rows[0]["截止日期"]).ToString("yyyy-MM-dd"); txt终止日期.Text = dt.Rows[0]["终止询价日期"].ToString().Trim(); lookUpEditTime.EditValue = Convert.ToDateTime(dt.Rows[0]["截止日期"]).ToString("HH:mm"); dtm单据日期.DateTime = Convert.ToDateTime(dt.Rows[0]["单据日期"]); txt制单人.EditValue = dt.Rows[0]["制单人"].ToString().Trim(); date制单日期.Text = dt.Rows[0]["制单日期"].ToString().Trim(); txt发布人.EditValue = dt.Rows[0]["发布人"].ToString().Trim(); date_发布日期.Text = dt.Rows[0]["发布日期"].ToString().Trim(); txt提交人.EditValue = dt物料列表.Rows[0]["提交人"].ToString().Trim(); txt提交日期.Text = dt物料列表.Rows[0]["提交时间"].ToString().Trim(); }