protected override void billSearch() { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("请输入条件【损益日期】!"); return; } string strSql = @"SELECT A.*,F_GETUSERNAME(LRY) LRYNAME,F_GETUSERNAME(SHR) SHRNAME,F_GETDEPTNAME(DEPTID) DEPTIDNAME,F_GETSYTYPENAME(SYTYPE) SYTYPENAME,DECODE(FLAG,'N','已提交','Y','已审核','R','已驳回','已执行') FLAGNAME,F_GETSYTYPENAME(SYTYPE) SYTYPENAME FROM DAT_SY_DOC A WHERE A.FLAG <>'M' "; string strSearch = ""; if (lstBILLNO.Text.Length > 0) { strSearch += string.Format(" AND SEQNO like '%{0}%'", lstBILLNO.Text); } if (lisFLAG.SelectedValue.Length > 0) { strSearch += string.Format(" AND FLAG = '{0}'", lisFLAG.SelectedValue); } strSearch += string.Format(" AND (LRRQ between TO_DATE('{0}','YYYY-MM-DD') and (TO_DATE('{1}','YYYY-MM-DD')) + 1)", lstLRRQ1.Text, lstLRRQ2.Text); if (!string.IsNullOrWhiteSpace(strSearch)) { strSql += strSearch; } strSql += " ORDER BY LRRQ DESC"; highlightRows.Text = ","; DataTable dtBill = new DataTable(); dtBill = DbHelperOra.Query(strSql).Tables[0]; GridList.DataSource = dtBill; GridList.DataBind(); }
protected override void billSearch() { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("请输入条件【盘点日期】!"); return; } string strSql = @"select a.*,F_GETUSERNAME(LRY) LRYNAME,F_GETUSERNAME(SPR) SPRNAME,F_GETDEPTNAME(DEPTID) DEPTIDNAME,decode(FLAG,'N','新单','Y','已审核','已完结') FLAGNAME,DECODE(SYTYPE,'4','盘点','0','益余','1','损耗','未定义') SYTYPENAME from dat_sy_doc a "; string strSearch = " where "; strSearch += string.Format(" deptid in( select code FROM SYS_DEPT where F_CHK_DATARANGE(CODE, '{0}') = 'Y' )", UserAction.UserID); strSearch += string.Format(" AND (LRRQ between TO_DATE('{0}','YYYY-MM-DD') and (TO_DATE('{1}','YYYY-MM-DD')) + 1)", lstLRRQ1.Text, lstLRRQ2.Text); if (lstBILLNO.Text.Length > 0) { strSearch += string.Format(" AND SEQNO like '%{0}%'", lstBILLNO.Text); } if (!string.IsNullOrWhiteSpace(lstDEPTOUT.SelectedValue)) { strSearch += string.Format(" AND deptid ='{0}'", lstDEPTOUT.SelectedValue); } if (!string.IsNullOrWhiteSpace(strSearch)) { strSql += strSearch; } strSql += " ORDER BY LRRQ DESC"; DataTable dtBill = new DataTable(); dtBill = DbHelperOra.Query(strSql).Tables[0]; GridList.DataSource = dtBill; GridList.DataBind(); }
public void GetCompleted(object sender, API.ExecuteCompletedEventArgs e) { this.busy.IsBusy = false; if (e.Error != null) { MessageBox.Show(System.Windows.Application.Current.MainWindow, " 服务器错误\n" + e.Error.Message); return; } models.Clear(); API.Result res = e.Result; if (res.ReturnValue) { API.SearchModel smodel = res.Obj as API.SearchModel; List <API.RoleInfo> list = smodel.Result as List <API.RoleInfo>; models.AddRange(list); GridList.Rebind(); this.page.PageSize = (int)pagesize.Value; string[] data = new string[smodel.AllPages]; this.page.PageIndexChanged -= page_PageIndexChanged; this.page.Source = data; this.page.PageIndexChanged += page_PageIndexChanged; this.page.PageIndex = pageindex; } }
public void GetCompleted(object sender, API.ExecuteCompletedEventArgs e) { this.busy.IsBusy = false; models.Clear(); API.Result res = e.Result; if (res.ReturnValue) { API.SearchModel smodel = res.Obj as API.SearchModel; List <API.BorowInfo> list = smodel.Result as List <API.BorowInfo>; if (list != null) { foreach (var item in list) { if (string.IsNullOrEmpty(item.Borower)) { item.Borower = item.UserName; } } models.AddRange(list); GridList.Rebind(); } this.page.PageSize = (int)pagesize.Value; string[] data = new string[smodel.AllPages]; //PagedCollectionView pcv = new PagedCollectionView(data); this.page.PageIndexChanged -= page_PageIndexChanged; this.page.Source = data; this.page.PageIndexChanged += page_PageIndexChanged; this.page.PageIndex = pageindex; } }
protected override void billSearch() { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("请输入条件【盘点日期】!", MessageBoxIcon.Warning); return; } string strSql = @"select a.*,F_GETUSERNAME(LRY) LRYNAME,F_GETUSERNAME(SPR) SPRNAME,decode(FLAG,'N','新单','Y','已审核','S','已完结','R','已驳回','已提交') FLAGNAME,DECODE(PDTYPE,'1','普通盘点','2','动销盘点','3','月末盘点','4','APP盘点','未定义') PDTYPENAME from dat_pdplan_doc a where 1=1 "; string strSearch = ""; if (lstBILLNO.Text.Length > 0) { strSearch += string.Format(" AND SEQNO like '%{0}%'", lstBILLNO.Text); } if (lstFLAG.SelectedValue.Length > 0) { strSearch += string.Format(" AND FLAG='{0}'", lstFLAG.SelectedValue); } strSearch += string.Format(" AND (PDRQ between TO_DATE('{0}','YYYY-MM-DD') and (TO_DATE('{1}','YYYY-MM-DD')) + 1)", lstLRRQ1.Text, lstLRRQ2.Text); if (!string.IsNullOrWhiteSpace(strSearch)) { strSql += strSearch; } strSql += " ORDER BY PDRQ DESC"; DataTable dtBill = new DataTable(); dtBill = DbHelperOra.Query(strSql).Tables[0]; GridList.DataSource = dtBill; GridList.DataBind(); }
private void GetCompleted(object sender, API.ExecuteCompletedEventArgs e) { this.busy.IsBusy = false; models.Clear(); API.Result res = e.Result; if (res.ReturnValue) { API.SearchModel smodel = res.Obj as API.SearchModel; List <API.Book> list = smodel.Result as List <API.Book>; if (list != null) { var books = (from a in list orderby a.PubDate descending select a).ToList(); models.AddRange(books); GridList.Rebind(); } this.page.PageSize = (int)pagesize.Value; string[] data = new string[smodel.AllPages]; //PagedCollectionView pcv = new PagedCollectionView(data); this.page.PageIndexChanged -= page_PageIndexChanged; this.page.Source = data; this.page.PageIndexChanged += page_PageIndexChanged; this.page.PageIndex = pageindex; } }
private void FrmUdfMaster_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && this.ActiveControl != GridList) { SendKeys.Send("{Tab}"); } else if (e.KeyCode == Keys.Escape) { if (TxtListDescription.Visible == true) { GridControlMode(false); GridList.Focus(); } else if (BtnCancel.Enabled == true) { this.Tag = ""; BtnCancel.PerformClick(); } else if (BtnCancel.Enabled == false) { BtnExit.PerformClick(); } DialogResult = DialogResult.Cancel; return; } }
//Load grid and return as 2d Grids public static GridList GifToGrids(string filename) { #if !NET2 GridList grids = new GridList(); // Open a Stream and decode a GIF image Stream imageStreamSource = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); var decoder = new GifBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); decoder.Frames[0].Metadata.Freeze(); int width = GetMaxX(decoder); int height = GetMaxY(decoder); foreach (BitmapFrame frame in decoder.Frames) { frame.Freeze(); // Get a clone copy of the metadata var sourceMetadata = frame.Metadata as BitmapMetadata; int top = Int32.Parse(sourceMetadata.GetQuery("/imgdesc/Top").ToString()); int left = Int32.Parse(sourceMetadata.GetQuery("/imgdesc/Left").ToString()); Grid grid = new Grid(width, height, 1, 4); CopyBitmapSourceToGridPalette(frame, grid, top, left); grids.AddGrid(grid); } return(grids); #else return(null); #endif }
private void fillIndList() { string connectionString = ConfigurationManager.ConnectionStrings["CN"].ConnectionString; string sql = "Select *,IDT_MST.DPCD,ITMMST.NAME AS ITEMNAME,DEPT_MST.NAME AS DEPARTMENT From IDT_TRN INNER JOIN IDT_MST ON IDT_MST.COMP=IDT_TRN.COMP AND IDT_MST.INDNO=IDT_TRN.INDNO INNER JOIN ITMMST ON IDT_TRN.ICOD =ITMMST.CODE LEFT JOIN DEPT_MST ON IDT_MST.COMP =DEPT_MST.COMP AND IDT_MST.UNIT =DEPT_MST.UNIT AND IDT_MST.DPCD =DEPT_MST.CODE WHERE (ITEMSTATUS='N' OR ITEMSTATUS='H') AND IDT_TRN.COMP='0001' AND IDT_TRN.UNIT ='000001' AND IDT_TRN.RECSTAT <> 'D'"; using (SqlConnection sqlConnection = new SqlConnection(connectionString)) { using (SqlCommand cmd = new SqlCommand(sql)) { using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = sqlConnection; sda.SelectCommand = cmd; using (DataTable dt = new DataTable()) { sda.Fill(dt); GridList.DataSource = dt; GridList.DataBind(); GridList.HeaderRow.TableSection = TableRowSection.TableHeader; } } } } }
protected void btnSearch() { string strSQL = " select seqno,isprivate,(select username from sys_operuser where userid = lrr) as lrName,lrrq,title,Memo,waringRQ,lookper,(select username from sys_operuser where userid = closeper) as closename, closerq ,case when flag = 'N' then '新备忘' when flag='C' then '已取消' else '已完成' end as status from sys_mymemo where (lrr='" + UserAction.UserID + "' or LookPer||',' like '%" + UserAction.UserID + ",%') "; if (!string.IsNullOrEmpty(tbSearchTitle.Text.Trim())) { strSQL += " AND TITLE LIKE '%" + tbSearchTitle.Text.Trim() + "'"; } if (dpSearchStart.SelectedDate != null) { strSQL += " AND lrrq >=to_date('" + Convert.ToDateTime(dpSearchStart.SelectedDate).ToString("yyyy-MM-dd") + "','YYYY-MM-DD')"; } if (dpSearchEnd.SelectedDate != null) { strSQL += " AND lrrq <to_date('" + Convert.ToDateTime(dpSearchEnd.SelectedDate).ToString("yyyy-MM-dd") + "','YYYY-MM-DD')+1"; } strSQL += " order by lrrq desc"; int total = 0; DataTable dt = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, strSQL, ref total); GridList.DataSource = dt; GridList.RecordCount = total; GridList.DataBind(); }
protected override void billSearch() { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("请输入条件【结算日期】!"); return; } DataTable dtBill = DbHelperOra.Query(GetQuerySql()).Tables[0]; GridList.DataSource = dtBill; GridList.DataBind(); //计算合计数量 decimal bzslTotal = 0, feTotal = 0, feeTotal = 0; foreach (DataRow row in dtBill.Rows) { bzslTotal += Convert.ToDecimal(string.IsNullOrWhiteSpace(row["XSJE"].ToString()) ? "0" : row["XSJE"]); feeTotal += Convert.ToDecimal(string.IsNullOrWhiteSpace(row["THJE"].ToString()) ? "0" : row["THJE"]); feTotal += Convert.ToDecimal(string.IsNullOrWhiteSpace(row["YJJJ"].ToString()) ? "0" : row["YJJJ"]); } JObject summary = new JObject(); summary.Add("FLAGNAME", "本页合计"); summary.Add("XSJE", bzslTotal.ToString("F2")); summary.Add("THJE", feeTotal.ToString("F2")); summary.Add("YJJJ", feTotal.ToString("F2")); GridList.SummaryData = summary; }
protected void btnSearch_Click(object sender, EventArgs e) { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("请输入条件【申领日期】!", "提示信息", MessageBoxIcon.Warning); return; } else if (lstLRRQ1.SelectedDate > lstLRRQ2.SelectedDate) { Alert.Show("【开始日期】大于【结束日期】,请重新输入!", "提示信息", MessageBoxIcon.Warning); return; } int total = 0; DataTable dt = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, GetSearchSQL(), ref total); GridList.DataSource = dt; GridList.RecordCount = total; GridList.DataBind(); decimal Total1 = 0, Total2 = 0; foreach (DataRow row in dt.Rows) { Total1 += Convert.ToDecimal(row["SUBSUM"] ?? "0"); Total2 += Convert.ToDecimal(row["SUBNUM"] ?? "0"); } JObject summary = new JObject(); summary.Add("DEPTOUTNAME", "本页合计"); summary.Add("SUBSUM", Total1); summary.Add("SUBNUM", Total2); GridList.SummaryData = summary; }
void BindGrid() { List <RzViewContent> rz = RZSource.Init.GetRzSourceByType(RzType, pType); GridList.DataSource = rz; GridList.DataBind(); }
protected void PatInfo_Query() { string PATIC = SearchID.Text; string PATNAME = SearchName.Text; string sql; sql = " SELECT pif_id, pif_name, if(pif_sex = 'M','男','女') as sex, pif_dob, pif_ic, pif_docname FROM pat_info "; sql += "WHERE 1=1 "; if (!string.IsNullOrEmpty(PATNAME)) //姓名篩選 { sql += "AND pif_name like '%" + PATNAME + "%' "; } if (!string.IsNullOrEmpty(PATIC)) //身分證號篩選 { sql += "AND pif_ic like '%" + PATIC + "%' "; } sql += "ORDER BY pif_id "; DataTable dt = db.Query(sql); Store istore = GridList.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); Window1.Show(); }
/// <summary> /// 沒有_PAT_ID的時候, 用這個函式來顯示頁面(不論是歷史病患或是當前病患) /// </summary> protected void show1() { //string chkmth = DateTime.Now.AddMonths(-1).ToString("yyyy-MM"); //String weekType = getWeekType(); DateTime datetime = DateTime.Now; int iOrn = 0; string weekType = (0 == (iOrn = datetime.DayOfWeek.GetHashCode()) ? 7 : iOrn).ToString(); // 一般程式(Basic,C,Delphi...) 週末指星期六,其實星期日是每週的第一日。 String date = datetime.ToString("yyyy-MM-dd"); //String ldate = datetime.AddMonths(-1).ToString("yyyy-MM-dd").Substring(0, 8); //string days = DateTime.DaysInMonth(int.Parse(ldate.Substring(0, 4)), int.Parse(ldate.Substring(5, 2))).ToString(); String sql = " SELECT p.pif_id ,"; sql += " P.pif_name AS PERSON_NAME,"; sql += " if (P.pif_sex = 'M','男','女') as sex,"; sql += " P.pif_dob, "; sql += " P.pif_ic, "; //sql += " if (e.txt_10 = '','血透','腹透') as txt_10,"; sql += " if (b.next_visit_date > '','腹透','血透') as txt_10,"; sql += " b.next_visit_date,"; sql += " e.dat_9,"; sql += " e.info_date as info_date1,"; sql += " if (g.BI > 0,'V',' ') as txt_101,"; sql += " case f.opt_1 when '1' then '退出' when '2' then '移植' when '3' then '转出' when '4' then '死亡'"; sql += " when '5' then '转入' else '' end,"; sql += " f.info_date,"; sql += " ' ',"; //sql += " dchk.NotChecked,"; sql += " p.pif_docname,"; sql += " V.pv_weight AS PERSON_WEIGHT,"; sql += " V.pv_macstat AS PERSON_STATE "; sql += " FROM mac_setup M LEFT JOIN appointment_setup A ON M.mac_flr = A.apptst_flr "; sql += " AND M.mac_sec = A.apptst_sec AND M.mac_bedno = A.apptst_bed AND A.apptst_daytyp='" + weekType + "'"; sql += " LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + date + "'"; sql += " LEFT JOIN pat_info P ON A.apptst_patic=P.pif_ic "; sql += " left join zinfo_f_012 e on P.pif_id = e.pat_id "; sql += " left join zinfo_a_07 f on P.pif_id = f.pat_id "; sql += " left join (SELECT pat_id, MAX(dat_3) AS next_visit_date FROM zinfo_p_06 group by pat_id) b on P.pif_id=b.pat_id"; sql += " left join BI_SUM_View g on P.pif_id = g.pat_no"; //sql += " left join (SELECT pif_id,SUM(NotChecked) AS NotChecked FROM"; //sql += " (SELECT pi.pif_id, pi.pif_name, pi.pif_ic, pi.RESULT_CODE, ars.RESULT_VALUE, if (ars.RESULT_VALUE > 0, 0, 1) as NotChecked"; //sql += " FROM (SELECT pio.pif_id, pio.pif_name, pio.pif_ic, bcl.RESULT_CODE"; //sql += " FROM pat_info pio"; //sql += " NATURAL JOIN bio_check_list bcl"; //sql += " where bcl.I_MONTH = 1) pi"; //sql += " LEFT JOIN (SELECT arl.pat_no, arl.result_date, arl.result_code, arl.RESULT_VALUE_T AS RESULT_VALUE"; //sql += " FROM a_result_log arl"; //sql += " where arl.RESULT_CODE IN (SELECT RESULT_CODE FROM bio_check_list where I_MONTH = 1)"; //sql += " and result_date >= '" + ldate + "01' and result_date <= '" + ldate + days + "') ars on pi.pif_id = ars.pat_no and pi.RESULT_CODE = ars.RESULT_CODE"; //sql += " ORDER BY pi.pif_id) dc"; //sql += " GROUP BY pif_id) dchk on p.pif_id = dchk.pif_id"; this.CommandColumn1.Text = "填寫信息"; //((GridCommand)this.CommandColumn1.Commands[0]).Text = "查看信息"; Store istore = GridList.GetStore(); istore.DataSource = db.GetDataArray_AddRowNum(db.Query(sql)); istore.DataBind(); }
protected void PatInfo_Query() { string PATIC = SearchID.Text; string PATNAME = SearchName.Text; string sql; sql = " SELECT p.pif_id, p.pif_name, if(p.pif_sex = 'M','男','女') as sex, p.pif_dob, p.pif_ic, p.pif_docname, "; sql += "if((SELECT count(*) FROM blood_group bg WHERE bg.bgrp_patic=p.pif_ic AND (bg.bgrp_aids='Y' OR bg.bgrp_syphilis='Y' OR bg.bgrp_hbv='Y' OR bg.bgrp_hcv='Y' OR bg.bgrp_diabetic='Y'))=1,'Y','N') AS pif_kind "; sql += "FROM pat_info p "; sql += "WHERE 1=1 "; if (!string.IsNullOrEmpty(PATNAME)) //姓名篩選 { sql += "AND p.pif_name like '%" + PATNAME + "%' "; } if (!string.IsNullOrEmpty(PATIC)) //身分證號篩選 { sql += "AND p.pif_ic like '%" + PATIC + "%' "; } sql += "ORDER BY pif_id "; DataTable dt = db.Query(sql); Store istore = GridList.GetStore(); istore.DataSource = db.GetDataArray(dt); istore.DataBind(); Window1.Show(); }
protected void Dialysis_detail(object sender, DirectEventArgs e) { string json = e.ExtraParams["Values"]; Dictionary <string, string>[] selRow = JSON.Deserialize <Dictionary <string, string>[]>(json); _PAT_IC = selRow[0]["pat_ic"].ToString(); _PIF_NAME = selRow[0]["pif_name"].ToString(); _USER_NAME = selRow[0]["pif_docname"].ToString(); _PIF_SX = selRow[0]["pif_sex"].ToString() + "性"; string sql = "SELECT pif_id, pif_name, pif_docname FROM pat_info "; sql += " where pif_ic = '" + _PAT_IC + "' "; DataTable dt = db.Query(sql); if (dt.Rows.Count > 0) { if (dt.Rows[0]["pif_docname"].ToString() != null) { _PatDocName = dt.Rows[0]["pif_docname"].ToString(); } else { _PatDocName = ""; } Session["PAT_ID"] = dt.Rows[0]["pif_id"].ToString(); _PAT_ID = Session["PAT_ID"].ToString(); Store istore = GridList.GetStore(); istore.RemoveAll(); Window1.Hide(); Load_Appointment(); } }
//未インポートのシナリオデータを追加 public void AddSrourceBook(StringGridDictionary book) { foreach (var sheet in book.List) { GridList.Add(sheet.Grid); } }
protected void btnSearch_Click(object sender, EventArgs e) { if (lstLRRQ1.SelectedDate == null) { Alert.Show("请输入条件【录入日期】!"); return; } string strSearch = ""; if (lstBILLNO.Text.Length > 0) { strSearch += string.Format(" AND A.BILLNO LIKE '%{0}%'", lstBILLNO.Text); } strSearch += string.Format(" AND A.FLAG='S'"); if (lstLRY.SelectedItem != null && lstLRY.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND A.LRY='{0}'", UserAction.UserID); } strSearch += string.Format(" AND A.LRRQ>=TO_DATE('{0}','YYYY-MM-DD')", lstLRRQ1.Text); if (!string.IsNullOrWhiteSpace(strSearch)) { strSql += strSearch; } GridList.DataSource = DbHelperOra.Query(strSql).Tables[0]; GridList.DataBind(); }
private void DataSearch() { if (PubFunc.StrIsEmpty(dpkKSRQ.SelectedDate.ToString()) || PubFunc.StrIsEmpty(dpkJSRQ.SelectedDate.ToString())) { Alert.Show("输入日期不正确,请检查!"); return; } if (dpkKSRQ.SelectedDate > dpkJSRQ.SelectedDate) { Alert.Show("开始日期不能大于结束日期!"); return; } string strMonitor = " "; strMonitor += " AND execrq BETWEEN TO_DATE('" + dpkKSRQ.Text + "','YYYY/MM/DD') and TO_DATE('" + dpkJSRQ.Text + "','YYYY/MM/DD') + 1"; if (chkCHULI.Checked) { strMonitor += " AND FLAG = 'N' "; } strSql = strSql + strMonitor; int total = 0; DataTable dtData = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, strSql, ref total); GridList.RecordCount = total; GridList.DataSource = dtData; GridList.DataBind(); }
private void BindGrid() { List <Res> cls = Res.Ress.FindAll( delegate(Res c) { return(c.Description != "Update by Excellent" && c.Description != "Profile" && c.IsPublished == true); }); // sort in descending order cls.Sort(delegate(Res c1, Res c2) { return(DateTime.Compare(c2.DateCreated, c1.DateCreated)); }); List <Res> Ress = new List <Res>(10); int limit = 0; for (int i = 0; i < cls.Count; i++)//only top 10 display { if (limit <= 10) { Ress.Add(cls[i]); limit++; } } GridList.DataSource = Ress; GridList.DataBind(); }
private void DataSearch() { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("请输入条件【查询期间】!", MessageBoxIcon.Warning); return; } else if (lstLRRQ1.SelectedDate > lstLRRQ2.SelectedDate) { Alert.Show("【开始日期】大于【结束日期】,请重新输入!", MessageBoxIcon.Warning); return; } if (ddlDEPTID.SelectedValue.Length < 1) { Alert.Show("请输入条件【库房】!", MessageBoxIcon.Warning); return; } int total = 0; DataTable dtData = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, GetSearchSql(), ref total); GridList.RecordCount = total; GridList.DataSource = dtData; GridList.DataBind(); }
protected override void billSearch() { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("请输入条件【申领日期】!", "提示信息", MessageBoxIcon.Warning); return; } else if (lstLRRQ1.SelectedDate > lstLRRQ2.SelectedDate) { Alert.Show("【开始日期】大于【结束日期】,请重新输入!", "提示信息", MessageBoxIcon.Warning); return; } string strSql = @"SELECT A.SEQNO,A.BILLNO,A.FLAG,F_GETDEPTNAME(A.DEPTID) DEPTID,A.XSRQ,F_GETDEPTNAME(A.DEPTOUT) DEPTOUT, DECODE(A.FLAG,'M','新单','N','已提交','S' ,'已分配','R' ,'已驳回','Y' ,'已出库','G' ,'已结算') FLAG_CN, A.SUBNUM,F_GETUSERNAME(A.SLR) SLR,F_GETUSERNAME(A.LRY) LRY,A.LRRQ,F_GETUSERNAME(A.SHR) SHR,A.SHRQ,A.MEMO,A.STR2,DECODE(OPER,'P','已打印','未打印') PRINT, FUNCTIME,OPERUSER,OPERTIME FROM DAT_CK_DOC A, SYS_FUNCPRNNUM B WHERE A.XSTYPE='1' AND A.BILLTYPE='LCD' AND A.SEQNO = B.FUNCNO(+) "; string strSearch = ""; if (lstBILLNO.Text.Length > 0) { strSearch += string.Format(" AND A.BILLNO LIKE '%{0}%'", lstBILLNO.Text); } if (lstFLAG.SelectedItem != null && lstFLAG.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND A.FLAG='{0}'", lstFLAG.SelectedItem.Value); } if (tbxSTR2.Text.Trim().Length > 0) { strSearch += string.Format(" AND A.STR2 LIKE '%{0}%'", tbxSTR2.Text.Trim()); } if (lstDEPTID.SelectedItem != null && lstDEPTID.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND A.DEPTID='{0}'", lstDEPTID.SelectedItem.Value); } if (lstDEPTOUT.SelectedItem != null && lstDEPTOUT.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND DEPTOUT='{0}'", lstDEPTOUT.SelectedItem.Value); } if (lstLRY.SelectedItem != null && lstLRY.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND LRY = '{0}'", lstLRY.SelectedItem.Value); } strSearch += string.Format(" AND deptid in( select code FROM SYS_DEPT where type <>'1' and F_CHK_DATARANGE(CODE, '{0}') = 'Y' )", UserAction.UserID); strSearch += string.Format(" AND A.LRRQ>=TO_DATE('{0}','YYYY-MM-DD')", lstLRRQ1.Text); strSearch += string.Format(" AND A.LRRQ <TO_DATE('{0}','YYYY-MM-DD') + 1", lstLRRQ2.Text); if (!string.IsNullOrWhiteSpace(strSearch)) { strSql += strSearch; } strSql += " ORDER BY DECODE(A.FLAG,'M','1','N','2','S' ,'3','R' ,'4','Y' ,'5','G' ,'6','7'),A.BILLNO DESC"; int total = 0; GridList.DataSource = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, strSql, ref total); GridList.RecordCount = total; GridList.DataBind(); }
protected override void billSearch() { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("请输入条件【申领日期】!"); return; } else if (lstLRRQ1.SelectedDate > lstLRRQ2.SelectedDate) { Alert.Show("开始日期大于结束日期,请重新输入!"); return; } string strSql = @"SELECT A.SEQNO,A.BILLNO,B.NAME FLAG_CN,A.FLAG,F_GETDEPTNAME(A.DEPTID) DEPTID,A.XSRQ,F_GETDEPTNAME(A.DEPTOUT) DEPTOUT, A.SUBNUM,F_GETUSERNAME(A.SLR) SLR,F_GETUSERNAME(A.LRY) LRY,A.LRRQ,F_GETUSERNAME(A.SHR) SHR,A.SHRQ,A.MEMO from DAT_SL_DOC A, SYS_CODEVALUE B WHERE A.FLAG = B.CODE AND B.TYPE ='DIC_BILLSTATUS' AND BILLTYPE='LYD' AND XSTYPE='1' AND A.FLAG IN('N','S','B','F') "; string strSearch = ""; if (lstBILLNO.Text.Length > 0) { strSearch += string.Format(" AND A.BILLNO LIKE '%{0}%'", lstBILLNO.Text); } if (lstFLAG.SelectedItem != null && lstFLAG.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND A.FLAG='{0}'", lstFLAG.SelectedItem.Value); } if (lstDEPTID.SelectedValue != null && lstDEPTID.SelectedValue.Length > 0) { strSearch += string.Format(" AND A.DEPTID='{0}'", lstDEPTID.SelectedValue); } if (lstDEPTOUT.SelectedItem != null && lstDEPTOUT.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND DEPTOUT='{0}'", lstDEPTOUT.SelectedItem.Value); } if (lstSLR.SelectedItem != null && lstSLR.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND SLR='{0}'", lstSLR.SelectedItem.Value); } strSearch += string.Format(" AND deptid in( select code FROM SYS_DEPT where type <>'1' and F_CHK_DATARANGE(CODE, '{0}') = 'Y' )", UserAction.UserID); strSearch += string.Format(" AND A.XSRQ>=TO_DATE('{0}','YYYY-MM-DD')", lstLRRQ1.Text); strSearch += string.Format(" AND A.XSRQ <TO_DATE('{0}','YYYY-MM-DD') + 1", lstLRRQ2.Text); if (!string.IsNullOrWhiteSpace(strSearch)) { strSql += strSearch; } strSql += " ORDER BY A.BILLNO DESC"; highlightRows.Text = ""; highlightRowYellow.Text = ""; highRedlightRows.Text = ""; DataTable table = DbHelperOra.Query(strSql).Tables[0]; DataView view1 = table.DefaultView; view1.Sort = String.Format("{0} {1}", GridList.SortField, GridList.SortDirection); GridList.DataSource = view1; GridList.DataBind(); }
protected override void billSearch() { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("请输入条件【使用日期】!"); return; } else if (lstLRRQ1.SelectedDate > lstLRRQ2.SelectedDate) { Alert.Show("开始日期大于结束日期,请重新输入!"); return; } string strSql = @"SELECT A.SEQNO,A.BILLNO, a.flag, decode(a.flag,'M','新单','N','提交','Q','启用','S','已审核','Y','已审批','R','已驳回','F','已废弃') flagname, decode(a.XGTYPE,'N','新增','M','修改','D','作废') xgtypename, A.SUBNUM, F_GETUSERNAME(A.LRY) LRY, A.LRRQ, F_GETUSERNAME(A.SPR) SPR, A.SPRQ, F_GETUSERNAME(A.SHR) SHR, A.SHRQ, A.MEMO from DAT_TZSUP_DOC A WHERE 1=1 "; string strSearch = ""; if (lstBILLNO.Text.Length > 0) { strSearch += string.Format(" AND TRIM(UPPER(A.BILLNO)) LIKE '%{0}%'", lstBILLNO.Text.Trim().ToUpper()); } if (!string.IsNullOrWhiteSpace(lstFLAG.SelectedValue)) { strSearch += string.Format(" AND A.FLAG='{0}'", lstFLAG.SelectedValue); } if (Request.QueryString["oper"] != null) { string oper = Request.QueryString["oper"].ToString(); if (oper == "zj") { strSearch += string.Format(" AND A.FLAG<>'M'", lstFLAG.SelectedValue); } } strSearch += string.Format(" AND A.LRRQ>=TO_DATE('{0}','YYYY-MM-DD')", lstLRRQ1.Text); strSearch += string.Format(" AND A.LRRQ <TO_DATE('{0}','YYYY-MM-DD') + 1", lstLRRQ2.Text); if (!string.IsNullOrWhiteSpace(strSearch)) { strSql += strSearch; } strSql += " ORDER BY DECODE(A.FLAG,'M','1','R','2','N','3','Q','4','S','5','6'),A.BILLNO DESC"; highlightRowYellow.Text = ""; highlightRowRed.Text = ""; highlightRowGreen.Text = ""; GridList.DataSource = DbHelperOra.Query(strSql).Tables[0]; GridList.DataBind(); }
protected override void billSearch() { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("请输入条件【使用日期】!"); return; } else if (lstLRRQ1.SelectedDate > lstLRRQ2.SelectedDate) { Alert.Show("【开始日期】大于【结束日期】,请重新输入!", MessageBoxIcon.Warning); return; } string strSql = @"SELECT A.SEQNO,A.BILLNO,decode(A.FLAG,'N','新单','A','已提交','W','已出库','R','已驳回','Y','已收货','未定义') FLAGNAME,A.FLAG,F_GETDEPTNAME(A.DEPTID) DEPTID,A.XSRQ,F_GETDEPTNAME(A.DEPTOUT) DEPTOUT,A.SUBSUM, A.SUBNUM,F_GETUSERNAME(A.LRY) LRY,A.LRRQ,A.SHRQ,A.MEMO,F_GETUSERNAME(A.SHR) SHR from DAT_DB_DOC A WHERE BILLTYPE='DBD' AND XSTYPE='1' "; string strSearch = ""; if (tgbBILLNO.Text.Length > 0) { strSearch += string.Format(" AND UPPER(TRIM(A.BILLNO)) LIKE '%{0}%'", tgbBILLNO.Text.Trim().ToUpper()); } if (lstDEPTID.SelectedItem != null && lstDEPTID.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND A.DEPTID='{0}'", lstDEPTID.SelectedItem.Value); } if (ddlDEPTOUT.SelectedValue.Length > 0) { strSearch += string.Format(" AND A.DEPTOUT='{0}'", ddlDEPTOUT.SelectedItem.Value); } if (!PubFunc.StrIsEmpty(lstFLAG.SelectedValue)) { strSearch += string.Format(" AND A.FLAG='{0}'", lstFLAG.SelectedValue); } strSearch += string.Format(" AND deptid in( select code FROM SYS_DEPT where F_CHK_DATARANGE(CODE, '{0}') = 'Y' )", UserAction.UserID); strSearch += string.Format(" AND A.XSRQ>=TO_DATE('{0}','YYYY-MM-DD')", lstLRRQ1.Text); strSearch += string.Format(" AND A.XSRQ <TO_DATE('{0}','YYYY-MM-DD') + 1", lstLRRQ2.Text); if (!string.IsNullOrWhiteSpace(strSearch)) { strSql += strSearch; } if (hdfOper.Text == "audit") { strSql += " AND A.FLAG IN('A','W') "; } else { strSql += " AND A.FLAG IN('N','A') "; } strSql += " ORDER BY A.BILLNO DESC"; highlightRows.Text = ""; highlightRowYellow.Text = ""; highlightRowRed.Text = ""; GridList.DataSource = DbHelperOra.Query(strSql).Tables[0]; GridList.DataBind(); }
protected void billSearch() { string strSql = @"select A.GDSEQ, A.GDNAME, A.GDSPEC, f_getunitname(A.UNIT) UNIT, f_getdeptname(B.DEPTID) DEPTIDname, B.DEPTID, B.ZDKC, B.ZGKC, B.DSNUM, B.NUM1, B.NUM2, B.NUM3, F_GETISCOLLECT(B.DEPTID, A.GDSEQ) COLLECT, F_GETPRODUCERNAME(A.PRODUCER) PRODUCERNAME, PIZNO, (B.DSNUM * B.NUM1) DSKUCUN, NVL(B.DSPOOL, 0) DSPOOL, --DECODE((NVL(B.DSNUM, 0) - NVL(B.NUM3, 0)), 0, '已配送', NVL(B.DSNUM, 0) - NVL(B.NUM3, 0)) NOTDS --应出定数 = 定数数量-代收定数-定数预占 CASE WHEN (NVL(B.DSNUM, 0) - NVL(B.NUM3, 0) - NVL(B.DSPOOL, 0)) >0 THEN (NVL(B.DSNUM, 0) - NVL(B.NUM3, 0) - NVL(B.DSPOOL, 0)) --WHEN (NVL(B.DSNUM, 0) - NVL(B.NUM3, 0) - NVL(B.DSPOOL, 0)) <= 0 THEN 0 ELSE 0 END YCDS from doc_goods A, DOC_GOODSCFG B where a.gdseq(+) = b.gdseq"; string strSearch = ""; string strSearchOrder = " order by A.GDSEQ"; if (tbxGDSEQ.Text.Trim().Length > 0) { strSearch += string.Format(" AND (B.GDSEQ LIKE '%{0}%' OR A.GDNAME LIKE '%{0}%')", tbxGDSEQ.Text.Trim()); } if (lstDEPTID.SelectedItem != null && lstDEPTID.SelectedIndex > 0) { strSearch += string.Format(" AND B.DEPTID = '{0}'", lstDEPTID.SelectedValue); } if (ShowMode.Checked == false) { strSearch += " AND ((B.DSNUM >0 AND B.NUM1 > 0) or nvl(B.NUM3,0) >0 )"; } if (DbHelperOra.GetSingle(string.Format("select distinct deptid from SYS_USERRANGE t where userid='{0}'", UserAction.UserID)) != null) { strSearch += string.Format(" and b.deptid in (select distinct deptid from SYS_USERRANGE t where userid='{0}')", UserAction.UserID); } strSql += strSearch; strSql += strSearchOrder; int total = 0; DataTable dt = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, strSql, ref total); GridList.DataSource = dt; GridList.RecordCount = total; GridList.DataBind(); OutputSummaryData(dt); }
protected void bntSearch_Click(object sender, EventArgs e) { DataTable dt = DbHelperOra.Query(GetSql()).Tables[0]; GridList.DataSource = dt; GridList.DataBind(); btnAutoOrder.Enabled = true; }
public void GridList_remove() { var list = new GridList <int>(); list.Add(1); list.Add(5); list.Add(10); list.Add(12); list.Add(15); list.Add(19); list.Add(20); Assert.Equal(7, list.Count); Assert.True(list.TryErase(12, out var previous)); Assert.NotNull(previous); Assert.Equal(10, previous.Value); Assert.False(list.TrySearch(12, out previous)); Assert.Equal(10, previous.Value); list.TrySearch(5, out var node5); //deleting 12 again should return false Assert.False(list.TryErase(12, out previous, node5)); Assert.NotNull(previous); Assert.Equal(10, previous.Value); list.Add(7, node5); Assert.True(list.TrySearch(7, out previous)); //deleting 12 again should return false Assert.False(list.TryErase(12, out previous, node5)); Assert.NotNull(previous); Assert.Equal(10, previous.Value); //remove head Assert.True(list.TryErase(1, out previous)); Assert.Null(previous); Assert.False(list.TrySearch(1, out previous)); Assert.Null(previous);//previous is null for first node Assert.True(list.TrySearch(5, out previous)); Assert.False(list.TrySearch(3, out previous)); Assert.Null(previous);// previous is null if query is before first node //remove tail Assert.True(list.TryErase(20, out previous)); Assert.NotNull(previous); Assert.Equal(19, previous.Value); Assert.False(list.TrySearch(20, out previous)); Assert.True(list.TrySearch(19, out previous)); Assert.Equal(5, list.Count); //perform some add after deletion list.Add(3); Assert.True(list.TrySearch(3, out previous)); list.Add(21); Assert.True(list.TrySearch(21, out previous)); Assert.Equal(7, list.Count); }
protected override void billSearch() { if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null) { Alert.Show("输入条件录入日期不正确!"); return; } else if (lstLRRQ1.SelectedDate > lstLRRQ2.SelectedDate) { Alert.Show("开始日期大于结束日期,请重新输入!"); return; } string strSql = @"SELECT A.SEQNO,A.BILLNO,DECODE(A.FLAG,'Y','已审核','R','已驳回','新单') FLAG,F_GETDEPTNAME(A.DEPTID) DEPTID,A.XSRQ,F_GETDEPTNAME(A.DEPTOUT) DEPTOUT, A.SUBNUM,F_GETUSERNAME(A.LRY) SLR,F_GETUSERNAME(A.LRY) LRY,A.LRRQ,A.SHR,F_GETUSERNAME(A.SHR) SHRNAME,A.SHRQ,A.MEMO from DAT_CK_DOC A WHERE BILLTYPE='DST' AND XSTYPE='2' "; string strSearch = ""; if (lstBILLNO.Text.Length > 0) { strSearch += string.Format(" AND A.BILLNO LIKE '%{0}%'", lstBILLNO.Text); } if (lstFLAG.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND A.FLAG='{0}'", lstFLAG.SelectedItem.Value); } if (lstSLR.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND A.SLR='{0}'", lstSLR.SelectedItem.Value); } if (lstDEPTID.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND A.DEPTID='{0}'", lstDEPTID.SelectedItem.Value); } if (lstDEPTOUT.SelectedItem.Value.Length > 0) { strSearch += string.Format(" AND DEPTOUT='{0}'", lstDEPTOUT.SelectedItem.Value); } if (tbxGDSEQ.Text.Trim().Length > 0) { strSearch += string.Format(" AND EXISTS (SELECT 1 FROM DAT_CK_COM C,DOC_GOODS B WHERE A.SEQNO = C.SEQNO AND C.GDSEQ = B.GDSEQ AND (B.GDSEQ LIKE '%{0}%' OR B.GDNAME LIKE '%{0}%' OR B.ZJM LIKE '%{0}%' OR B.BAR3 LIKE '%{0}%'))", tbxGDSEQ.Text.Trim().ToUpper()); } strSearch += string.Format(" AND deptid in( select code FROM SYS_DEPT where type <>'1' and F_CHK_DATARANGE(CODE, '{0}') = 'Y' )", UserAction.UserID); strSearch += string.Format(" AND A.LRRQ>=TO_DATE('{0}','YYYY-MM-DD')", lstLRRQ1.Text); strSearch += string.Format(" AND A.LRRQ <TO_DATE('{0}','YYYY-MM-DD') + 1", lstLRRQ2.Text); if (!string.IsNullOrWhiteSpace(strSearch)) { strSql += strSearch; } strSql += " ORDER BY A.BILLNO DESC"; highlightRows.Text = ""; GridList.DataSource = DbHelperOra.Query(strSql).Tables[0]; GridList.DataBind(); }