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(); }
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, 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 } }