protected void GridInTo() { if (GridGoods != null && GridGoods.Rows.Count > 0) { foreach (GridRow row in GridGoods.Rows) { hfdTEMP.Text += row.Values[1].ToString() + ","; } } hfdTEMP.Text += tbxSUPID.Text + ","; hfdTEMP.Text = hfdTEMP.Text.TrimEnd(',').Replace(",", "','"); GridGoods.DataSource = DbHelperOra.Query(@"SELECT T.*, DECODE(T.STR1, 'Y', '是', '否') STR1NAME, DECODE(T.ISSUPPLIER, 'Y', '是', '否') ISSUPPLIERNAME, DECODE(T.ISPRODUCER, '2', '是', '否') ISPRODUCERNAME FROM DOC_SUPPLIERTEMP T WHERE T.SUPID IN ('" + hfdTEMP.Text + "')").Tables[0]; GridGoods.DataBind(); string s = hfdIsNew.Text; hfdTEMP.Text = ""; WindowGoods.Hidden = true; tgbSearch.Text = string.Empty; GridSupplier.DataSource = null; GridSupplier.DataBind(); }
private void dataSearch() { int total = 0; string sql = @"select CODE,NAME,DECODE(FLAG,'Y','正常','N','停用','其他') flag, DECODE(OBJUSER,'SUPPLIER','供应商证照','GOODS','商品证照') objuser, decode(isneed,'Y','是','N','否') isneed, decode(isdate,'Y','是','N','否') isdate, decode(isdup,'Y','是','N','否') isdup, memo, SORT from doc_license WHERE 1=1"; string strFLAG = lstFLAG.SelectedValue.ToString(); string strOBJUSER = lstOBJUSER.SelectedValue.ToString(); if (!string.IsNullOrWhiteSpace(strFLAG)) { sql += " and FLAG = '" + strFLAG + "'"; } if (!string.IsNullOrWhiteSpace(strOBJUSER)) { sql += " and OBJUSER = '******'"; } string query = "%"; if (!string.IsNullOrWhiteSpace(tgbSearch.Text)) { query = tgbSearch.Text.Trim(); sql += string.Format(" and ( CODE like '%{0}%' or NAME like '%{0}%')", query); } DataTable dtData = PubFunc.DbGetPage(GridSupplier.PageIndex, GridSupplier.PageSize, sql, ref total); GridSupplier.RecordCount = total; GridSupplier.DataSource = dtData; //GridSupplier.DataSource = DbHelperOra.Query(string.Format(sql, query)); GridSupplier.DataBind(); }
private void dataSearch() { string query = "%"; if (!string.IsNullOrWhiteSpace(tgbSearch.Text)) { query = tgbSearch.Text.Trim(); } int total = 0; string sql = string.Format("select SUPID,SUPNAME,TEL,LINKMAN,LOGINADDR,DECODE(FLAG, 'Y', '审核通过', 'N', '未审核') flag,DECODE(ISDG,'Y','是','N','否') ISDG,DECODE(STR1,'Y','是','否') ISBD from DOC_SUPPLIER WHERE (SUPID like '%{0}%' or SUPNAME like'%{0}%') and FLAG<>'E'", query); if (!string.IsNullOrWhiteSpace(lstFLAG.SelectedValue)) { sql += string.Format(" and FLAG = '{0}'", lstFLAG.SelectedValue); } //if (!string.IsNullOrWhiteSpace(lstISSEND.SelectedValue)) //{ // sql += string.Format(" and ISSEND = '{0}'", lstISSEND.SelectedValue); //} DataTable dtData = PubFunc.DbGetPage(GridSupplier.PageIndex, GridSupplier.PageSize, sql, ref total); GridSupplier.RecordCount = total; GridSupplier.DataSource = dtData; GridSupplier.DataBind(); }
private void dataSearch() { string query = "%"; if (!string.IsNullOrWhiteSpace(tgbSearch.Text)) { query = tgbSearch.Text.Trim(); } int total = 0; string sql = string.Format(@"select SUPID, SUPNAME, TEL, LINKMAN, LOGINADDR, DECODE(FLAG, 'Y', '审核通过', 'N', '未审核') flag, DECODE(ISDG, 'Y', '是', 'N', '否') ISDG, DECODE(STR1, 'Y', '是', '否') ISBD, DECODE(ISSUPPLIER, 'Y', '供应商', '')|| DECODE(ISPRODUCER, 'Y', '生产商', '')|| DECODE(ISPSS, 'Y', '配送商', '') SUPNAMETYPE from DOC_SUPPLIER WHERE (SUPID like '%{0}%' or SUPNAME like '%{0}%')", query); if (!string.IsNullOrWhiteSpace(lstFLAG.SelectedValue)) { sql += string.Format(" and FLAG = '{0}'", lstFLAG.SelectedValue); } if (!string.IsNullOrWhiteSpace(lstSTR1.SelectedValue)) { sql += string.Format(" and str1 = '{0}'", lstSTR1.SelectedValue); } if (!string.IsNullOrEmpty(lstSuppType.SelectedValue)) { if (lstSuppType.SelectedValue.Equals("X")) {//供应商 sql += " AND ISSUPPLIER = 'Y' "; } else if (lstSuppType.SelectedValue.Equals("Y")) {//配送商 sql += " AND ISPSS = 'Y'"; } else if (lstSuppType.SelectedValue.Equals("Z")) {//生产商 sql += " AND ISPRODUCER ='Y' "; } } DataTable dtData = PubFunc.DbGetPage(GridSupplier.PageIndex, GridSupplier.PageSize, sql, ref total); GridSupplier.RecordCount = total; GridSupplier.DataSource = dtData; GridSupplier.DataBind(); }
protected void btnDelect_Click(object sender, EventArgs e) { hfdIsNew.Text = "D"; PubFunc.FormDataClear(FormProducer); btnUpdate.Enabled = false; btnAddRow.Enabled = false; tgbSearch.Text = ""; GridSupplier.DataSource = null; GridSupplier.DataBind(); WindowGoods.Hidden = false; GridSupplier.Hidden = false; PanelCond.Hidden = true; GridSupplier.Height = 420; }
private void dataSearch1() { //根据授权书里的商品查询生产厂商 string sql = @" select supid,supname,supcat,regid from doc_supplier t where isagent='Y' and flag='Y' union all select supid,supname,supcat,regid from doc_supplier t where issupplier='Y' "; string query = ""; StringBuilder strSql = new StringBuilder(sql); if (!string.IsNullOrWhiteSpace(trbSearch.Text)) { query = trbSearch.Text.Trim(); strSql.AppendFormat(" and (supid LIKE '%{0}%' or supname like '%{0}%')", query); } int total = 0; DataTable dtData = PubFunc.DbGetPage(GridSupplier.PageIndex, GridSupplier.PageSize, strSql.ToString(), ref total); GridSupplier.RecordCount = total; GridSupplier.DataSource = dtData; GridSupplier.DataBind(); }
private void dataSearch() { string query = "%"; if (!string.IsNullOrWhiteSpace(tbxSUPPNAME.Text)) { query = tbxSUPPNAME.Text.Trim(); } int total = 0; string sql = string.Format(@"select SUPID,SUPNAME,DECODE(FLAG, 'Y', '审核通过', 'N', '未审核') flag,DECODE(ISAGENT,'Y','代理商') ISAGENT,TEL,FAX,ZZADDR,EMAIL,LOGINADDR,URL,LEADER,DECODE(ISAGENT, 'Y', '配送商', '') ISAGENTN from DOC_SUPPLIER WHERE (SUPID like '%{0}%' or SUPNAME like '%{0}%') AND ISAGENT='Y'", query); if (!string.IsNullOrWhiteSpace(ddlFLAG.SelectedValue)) { sql += string.Format(" and FLAG = '{0}'", ddlFLAG.SelectedValue); } DataTable dtData = PubFunc.DbGetPage(GridSupplier.PageIndex, GridSupplier.PageSize, sql, ref total); GridSupplier.RecordCount = total; GridSupplier.DataSource = dtData; GridSupplier.DataBind(); }
private void dataSearch() { int total = 0; string sql = @"select CODE,NAME,DECODE(FLAG, '1', '待生效', '2', '有效', '3','停用','4','失效','5','删除') flag, DECODE(OBJUSER,'SUP_LIC','供应商证照','PRO_LIC','生产厂家证照','SER_LIC','售后机构证照','AGE_LIC','代理商证照','GOODS_LIC','商品证照','SUPC_LIC','承诺书') objuser, decode(isneed,'Y','是','N','否') isneed, decode(isdate,'Y','是','N','否') isdate, decode(isdup,'Y','是','N','否') isdup, memo, SORT from doc_license WHERE 1=1"; string strFLAG = lstFLAG.SelectedValue.ToString(); string strOBJUSER = lstOBJUSER.SelectedValue.ToString(); if (!string.IsNullOrWhiteSpace(strFLAG)) { sql += " and FLAG = '" + strFLAG + "'"; } if (!string.IsNullOrWhiteSpace(strOBJUSER)) { sql += " and OBJUSER = '******'"; } if (!string.IsNullOrEmpty(txtName.Text.Trim())) { sql += " and Name LIKE '%" + txtName.Text.Trim() + "%'"; } string query = "%"; //if (!string.IsNullOrWhiteSpace(tgbSearch.Text)) //{ // query = tgbSearch.Text.Trim(); // sql += string.Format(" and ( CODE like '%{0}%' or NAME like '%{0}%')", query); //} DataTable dtData = PubFunc.DbGetPage(GridSupplier.PageIndex, GridSupplier.PageSize, sql, ref total); GridSupplier.RecordCount = total; GridSupplier.DataSource = dtData; //GridSupplier.DataSource = DbHelperOra.Query(string.Format(sql, query)); GridSupplier.DataBind(); }
private void dataSearch(string type = "left") { int total = 0; string msg = ""; NameValueCollection nvc = new NameValueCollection(); if (type == "left") { //if (ddlCATID.SelectedValue.Length > 0) nvc.Add("CATID", ddlCATID.SelectedValue); //if (tgbSearch.Text.Length > 0) nvc.Add("CX", tgbSearch.Text); //if (ddlDept.SelectedValue.Length > 0) nvc.Add("LEFT", ddlDept.SelectedValue); //GridSupplier.DataSource = GetSupplierList(GridSupplier.PageIndex, GridSupplier.PageSize, nvc, ref total, ref msg); //GridSupplier.DataBind(); //GridSupplier.RecordCount = total; dtTotal = getDGSupplier(); DataTable dt = SplitDataTable(dtTotal, GridSupplier.PageIndex, GridSupplier.PageSize); GridSupplier.DataSource = dt; GridSupplier.DataBind(); GridSupplier.RecordCount = dtTotal.Rows.Count; hfdGridSupDisabled.Text = ""; DataTable dtLocal = DbHelperOra.Query("select * from doc_supplier").Tables[0]; foreach (DataRow dr in dt.Rows) { foreach (DataRow drLocal in dtLocal.Rows) { if (dr["SUPID"].ToString().Equals(drLocal["SUPID"].ToString())) { int index = dt.Rows.IndexOf(dr); hfdGridSupDisabled.Text += index.ToString() + ","; break; } } } //PageContext.RegisterStartupScript("setDisableClass();"); } else if (type == "right") { if (trbSearch.Text.Length > 0) { nvc.Add("CX", trbSearch.Text); } //if (ddlDept.SelectedValue.Length > 0) nvc.Add("RIGHT", ddlDept.SelectedValue); DataTable dt = GetSupplierList(GridCFGSupplier.PageIndex, GridCFGSupplier.PageSize, nvc, ref total, ref msg); GridCFGSupplier.DataSource = dt;//GetSupplierList(GridCFGSupplier.PageIndex, GridCFGSupplier.PageSize, nvc, ref total, ref msg); GridCFGSupplier.DataBind(); GridCFGSupplier.RecordCount = total; foreach (DataRow dr in dt.Rows) { if (DbHelperOra.Exists("SELECT 1 FROM DAT_GOODSSTOCK WHERE KCSL > 0 AND SUPID = '" + dr["SUPID"] + "'")) { int index = dt.Rows.IndexOf(dr); hfdGridSupDisabled1.Text += index.ToString() + ","; } } PageContext.RegisterStartupScript("setDisableYiyuan();"); //setDisableYiyuan } }
protected void btnAddRight_Click(object sender, EventArgs e) { int[] selectArray = GridSupplier.SelectedRowIndexArray; if (selectArray.Length > 0) { String strData = hfdGridSupplier.Text; DataTable dt = JsonConvert.DeserializeObject <DataTable>(strData); List <CommandInfo> cmdList = new List <CommandInfo>(); for (int i = 0; i < selectArray.Length; i++) { MyTable mySupplierCFG = new MyTable("DOC_SUPPLIER"); Hashtable ht = new Hashtable(mySupplierCFG.ColRow); foreach (DictionaryEntry de in ht) { if (dt.Columns.Contains(de.Key.ToString())) { mySupplierCFG.ColRow[de.Key.ToString()] = dt.Rows[selectArray[i]][de.Key.ToString()]; } } #region not use //mySupplierCFG.ColRow["SUPID"] = dt.Rows[selectArray[i]]["SUPID"]; //mySupplierCFG.ColRow["SUPNAME"] = dt.Rows[selectArray[i]]["SUPNAME"]; //mySupplierCFG.ColRow["SUPENAME"] = dt.Rows[selectArray[i]]["SUPENAME"]; //mySupplierCFG.ColRow["SUPSIMNAME"] = dt.Rows[selectArray[i]]["SUPSIMNAME"]; //mySupplierCFG.ColRow["SUPSIMID"] = dt.Rows[selectArray[i]]["SUPSIMID"]; //mySupplierCFG.ColRow["FLAG"] = dt.Rows[selectArray[i]]["FLAG"]; //mySupplierCFG.ColRow["SUBJECT"] = dt.Rows[selectArray[i]]["SUBJECT"]; //mySupplierCFG.ColRow["SUPCAT"] = dt.Rows[selectArray[i]]["SUPCAT"]; //mySupplierCFG.ColRow["REGID"] = dt.Rows[selectArray[i]]["REGID"]; //mySupplierCFG.ColRow["CORPKID"] = dt.Rows[selectArray[i]]["CORPKID"]; //mySupplierCFG.ColRow["CORPTYPE"] = dt.Rows[selectArray[i]]["CORPTYPE"]; //mySupplierCFG.ColRow["YYZZNO"] = dt.Rows[selectArray[i]]["YYZZNO"]; //mySupplierCFG.ColRow["LOGINRQ"] = dt.Rows[selectArray[i]]["LOGINRQ"]; //mySupplierCFG.ColRow["LOGINLABEL"] = dt.Rows[selectArray[i]]["LOGINLABEL"]; //mySupplierCFG.ColRow["LOGINFUND"] = dt.Rows[selectArray[i]]["LOGINFUND"]; //mySupplierCFG.ColRow["JYGM"] = dt.Rows[selectArray[i]]["JYGM"]; //mySupplierCFG.ColRow["JYFW"] = dt.Rows[selectArray[i]]["JYFW"]; //mySupplierCFG.ColRow["TAXPAYER"] = dt.Rows[selectArray[i]]["TAXPAYER"]; //mySupplierCFG.ColRow["TAXRATE"] = dt.Rows[selectArray[i]]["TAXRATE"]; //mySupplierCFG.ColRow["TAXNO"] = dt.Rows[selectArray[i]]["TAXNO"]; //mySupplierCFG.ColRow["BANK"] = dt.Rows[selectArray[i]]["BANK"]; //mySupplierCFG.ColRow["ACCNTNO"] = dt.Rows[selectArray[i]]["ACCNTNO"]; //mySupplierCFG.ColRow["LOGINADDR"] = dt.Rows[selectArray[i]]["LOGINADDR"]; //mySupplierCFG.ColRow["LEADER"] = dt.Rows[selectArray[i]]["LEADER"]; //mySupplierCFG.ColRow["LEADERIDCARD"] = dt.Rows[selectArray[i]]["LEADERIDCARD"]; //mySupplierCFG.ColRow["TEL"] = dt.Rows[selectArray[i]]["TEL"]; //mySupplierCFG.ColRow["FAX"] = dt.Rows[selectArray[i]]["FAX"]; //mySupplierCFG.ColRow["TELSERVICE"] = dt.Rows[selectArray[i]]["TELSERVICE"]; //mySupplierCFG.ColRow["ZIP"] = dt.Rows[selectArray[i]]["ZIP"]; //mySupplierCFG.ColRow["EMAIL"] = dt.Rows[selectArray[i]]["EMAIL"]; //mySupplierCFG.ColRow["URL"] = dt.Rows[selectArray[i]]["URL"]; //mySupplierCFG.ColRow["ISGATHERING"] = dt.Rows[selectArray[i]]["ISGATHERING"]; //mySupplierCFG.ColRow["GATFUNDCORP"] = dt.Rows[selectArray[i]]["GATFUNDCORP"]; //mySupplierCFG.ColRow["GATFUNDBANK"] = dt.Rows[selectArray[i]]["GATFUNDBANK"]; //mySupplierCFG.ColRow["GATACCNTNO"] = dt.Rows[selectArray[i]]["GATACCNTNO"]; //mySupplierCFG.ColRow["ZZADDR"] = dt.Rows[selectArray[i]]["ZZADDR"]; //mySupplierCFG.ColRow["LINKMAN"] = dt.Rows[selectArray[i]]["LINKMAN"]; //mySupplierCFG.ColRow["LINKMANDUTY"] = dt.Rows[selectArray[i]]["LINKMANDUTY"]; //mySupplierCFG.ColRow["LINKTEL"] = dt.Rows[selectArray[i]]["LINKTEL"]; //mySupplierCFG.ColRow["LINKFAX"] = dt.Rows[selectArray[i]]["LINKFAX"]; //mySupplierCFG.ColRow["LINKEMAIL"] = dt.Rows[selectArray[i]]["LINKEMAIL"]; //mySupplierCFG.ColRow["CWLINKMAN"] = dt.Rows[selectArray[i]]["CWLINKMAN"]; //mySupplierCFG.ColRow["CWLINKDUTY"] = dt.Rows[selectArray[i]]["CWLINKDUTY"]; //mySupplierCFG.ColRow["CWLINKTEL"] = dt.Rows[selectArray[i]]["CWLINKTEL"]; //mySupplierCFG.ColRow["CWLINKFAX"] = dt.Rows[selectArray[i]]["CWLINKFAX"]; //mySupplierCFG.ColRow["CWLINKEMAIL"] = dt.Rows[selectArray[i]]["CWLINKEMAIL"]; //mySupplierCFG.ColRow["BUYERID"] = dt.Rows[selectArray[i]]["BUYERID"]; //mySupplierCFG.ColRow["APPLYDEPT"] = dt.Rows[selectArray[i]]["APPLYDEPT"]; //mySupplierCFG.ColRow["MANAGER"] = dt.Rows[selectArray[i]]["MANAGER"]; //mySupplierCFG.ColRow["CRERQ"] = dt.Rows[selectArray[i]]["CRERQ"]; //mySupplierCFG.ColRow["ZZRQ"] = dt.Rows[selectArray[i]]["ZZRQ"]; //mySupplierCFG.ColRow["BUYERID"] = dt.Rows[selectArray[i]]["BUYERID"]; //mySupplierCFG.ColRow["APPLYDEPT"] = dt.Rows[selectArray[i]]["APPLYDEPT"]; //mySupplierCFG.ColRow["MANAGER"] = dt.Rows[selectArray[i]]["MANAGER"]; //mySupplierCFG.ColRow["CRERQ"] = dt.Rows[selectArray[i]]["CRERQ"]; #endregion mySupplierCFG.ColRow["ISDG"] = "Y"; cmdList.Add(mySupplierCFG.Insert()); } //List<CommandInfo> cmdList = new List<CommandInfo>(); //MyTable mySupplierCFG = new MyTable("DOC_SUPPLIER_CUST"); //for (int i = 0; i < selectArray.Length; i++) //{ // //if (GridSupplier.Rows[selectArray[i]].Values[7].ToString() != "Y") // //{ // // Alert.Show(string.Format("供应商【{0}】状态信息错误!", GridSupplier.Rows[selectArray[i]].Values[2].ToString()), "消息提示", MessageBoxIcon.Warning); // // return; // //} // mySupplierCFG.ColRow.Clear(); // mySupplierCFG.ColRow.Add("SUPID", GridSupplier.Rows[selectArray[i]].Values[0]); // //mySupplierCFG.ColRow.Add("ISCFG", "1"); // cmdList.Add(mySupplierCFG.Insert()); //} DbHelperOra.ExecuteSqlTran(cmdList); CacheHelper.RemoveOneCache("DDL_DOC_SUPPLIER_DG"); hfdGridSupDisabled1.Text = ""; dataSearch(); Alert.Show("本地代管供应商信息添加成功,您需要【刷新】页面后才能进行【代管补货】操作!"); dataSearch("right"); } else { Alert.Show("请选择要添加的供应商信息!"); GridSupplier.Focus(); } }