コード例 #1
0
    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();
    }
コード例 #2
0
        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();
        }
コード例 #3
0
    void BindGrid()
    {
        List <RzViewContent> rz = RZSource.Init.GetRzSourceByType(RzType, pType);

        GridList.DataSource = rz;
        GridList.DataBind();
    }
コード例 #4
0
        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;
        }
コード例 #5
0
        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();
        }
コード例 #6
0
ファイル: TurnoverAnalysis.aspx.cs プロジェクト: cjllove/ERP
        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();
        }
コード例 #7
0
        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;
                        }
                    }
                }
            }
        }
コード例 #8
0
        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();
        }
コード例 #9
0
        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();
        }
コード例 #10
0
ファイル: sldUpload.aspx.cs プロジェクト: cjllove/ERP
        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();
        }
コード例 #11
0
        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;
        }
コード例 #12
0
ファイル: InventoryPlan.aspx.cs プロジェクト: cjllove/ERP
        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();
        }
コード例 #13
0
        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();
        }
コード例 #14
0
        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);
        }
コード例 #15
0
        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();
        }
コード例 #16
0
ファイル: DepartmentRefuse.aspx.cs プロジェクト: cjllove/ERP
        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();
        }
コード例 #17
0
ファイル: HighGoodsDB.aspx.cs プロジェクト: cjllove/ERP
        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();
        }
コード例 #18
0
ファイル: Autoship.aspx.cs プロジェクト: cjllove/ERP
        protected void bntSearch_Click(object sender, EventArgs e)
        {
            DataTable dt = DbHelperOra.Query(GetSql()).Tables[0];

            GridList.DataSource = dt;
            GridList.DataBind();
            btnAutoOrder.Enabled = true;
        }
コード例 #19
0
        protected override void billSearch()
        {
            int       total = 0;
            DataTable dt    = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, GetQuerySql(), ref total);

            GridList.DataSource  = dt;
            GridList.RecordCount = total;
            GridList.DataBind();
        }
コード例 #20
0
ファイル: ConstantRtn.aspx.cs プロジェクト: cjllove/ERP
        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();
        }
コード例 #21
0
ファイル: VersionInput.aspx.cs プロジェクト: cjllove/ERP
        protected void btnSearch()
        {
            string    strSQL = "SELECT SYSNAME,VERSION,UPTDATE,TO_CHAR(UPTMEMO) UPTMEMO,f_getusername(UPTPER) UPTPER, f_getusername(TESTPER) TESTPER,f_getusername(checkper) checkper FROM SYS_VERSION WHERE FLAG = 'Y' ORDER BY uptdate DESC";
            int       total  = 0;
            DataTable dt     = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, strSQL, ref total);

            GridList.DataSource  = dt;
            GridList.RecordCount = total;
            GridList.DataBind();
        }
コード例 #22
0
ファイル: DeptGzChange.aspx.cs プロジェクト: cjllove/ERP
        protected void GridList_Sort(object sender, GridSortEventArgs e)
        {
            GridList.SortDirection = e.SortDirection;
            GridList.SortField     = e.SortField;

            DataView view1 = PubFunc.GridDataGet(GridList).DefaultView;

            view1.Sort          = String.Format("{0} {1}", GridList.SortField, GridList.SortDirection);
            GridList.DataSource = view1;
            GridList.DataBind();
        }
コード例 #23
0
        private void DataQuery()
        {
            if (lstSCRQ1.SelectedDate == null || lstSCRQ2.SelectedDate == null)
            {
                Alert.Show("请输入条件【查询日期】!");
                return;
            }
            else if (lstSCRQ1.SelectedDate > lstSCRQ2.SelectedDate)
            {
                Alert.Show("开始日期大于结束日期,请重新输入!");
                return;
            }

            //string sql = "select A.*,B.DONAME from DAT_DO_LIST A,DAT_DO_TYPE B WHERE A.DOTYPE=B.DOTYPE ";
            string sql   = @"select A.*,
                                   f_getroleid(a.rolelist) ROLELISTNAME,
                                   B.DONAME,
                                   (case A.Flag
                                     when 'Y' then
                                      '信息已处理,不显示'
                                     when 'N' then
                                      '信息未处理,显示'
                                     else
                                      '维护信息'
                                   end) FLAGNAME,
                                   f_getusername(A.USERID) USERNAME,
                                   f_getusername(A.DOUSER) DOUSERNAME,
                                   C.FUNCNAME
                              from DAT_DO_LIST A, DAT_DO_TYPE B, SYS_FUNCTION C
                             WHERE A.DOTYPE = B.DOTYPE
                               AND A.FUNCID = C.FUNCID(+) ";
            int    total = 0;

            if (lstDOTYPE.SelectedItem != null && lstDOTYPE.SelectedItem.Value.Length > 0)
            {
                sql += string.Format(" AND A.DOTYPE='{0}'", lstDOTYPE.SelectedItem.Value);
            }
            if (lstFLAG.SelectedItem != null && lstFLAG.SelectedItem.Value.Length > 0)
            {
                sql += string.Format(" AND A.FLAG='{0}'", lstFLAG.SelectedItem.Value);
            }


            sql += string.Format(" AND a.scrq>=TO_DATE('{0}','yyyy-mm-dd hh24:mi:ss')", lstSCRQ1.SelectedDate);
            sql += string.Format(" AND a.scrq <=TO_DATE('{0}','yyyy-mm-dd hh24:mi:ss')+1 ", lstSCRQ2.SelectedDate);
            //  sql += string.Format("  AND F_CHK_ROLELIST(B.ROLELIST, '{0}') = 'Y'" , UserAction.UserRole);


            sql += " ORDER BY A.SCRQ DESC";

            GridList.DataSource  = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, sql, ref total);
            GridList.RecordCount = total;
            GridList.DataBind();
        }
コード例 #24
0
        private void DataSearch()
        {
            highlightRows.Text      = "";
            highlightRowsGreen.Text = "";

            int count = 0;

            GridList.DataSource  = GetDataTable(GridList.PageIndex, GridList.PageSize, GetSearchSql(), ref count);
            GridList.RecordCount = count;
            GridList.DataBind();
        }
コード例 #25
0
ファイル: HighGoodsRejected.aspx.cs プロジェクト: cjllove/ERP
        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, F_GETBILLFLAG(FLAG) FLAG_CN, FLAG,F_GETDEPTNAME(A.DEPTID) DEPTID,A.THRQ,F_GETSUPNAME(A.PSSID) SUPNAME,A.SUBSUM,
                                     A.SUBNUM,F_GETUSERNAME(A.CGY) CGY,F_GETUSERNAME(A.LRY) LRY,A.LRRQ,F_GETUSERNAME(A.SHR) SHR,A.SHRQ,A.MEMO
                                from DAT_TH_DOC A
                                WHERE NVL(A.NUM1,0) = 2 AND A.DEPTID in( select code FROM SYS_DEPT where F_CHK_DATARANGE(CODE, '" + UserAction.UserID + "') = 'Y' ) ";
            string strSearch = "";


            if (lstBILLNO.Text.Length > 0)
            {
                strSearch += string.Format(" AND UPPER(TRIM(A.BILLNO))  LIKE '%{0}%'", lstBILLNO.Text.Trim().ToUpper());
            }
            if (lstDEPTID.SelectedItem != null && lstDEPTID.SelectedItem.Value.Length > 0)
            {
                strSearch += string.Format(" AND A.DEPTID='{0}'", lstDEPTID.SelectedItem.Value);
            }
            if (lstCGY.SelectedItem != null && lstCGY.SelectedItem.Value.Length > 0)
            {
                strSearch += string.Format(" AND A.CGY='{0}'", lstCGY.SelectedItem.Value);
            }

            if (lstPSSID.SelectedItem != null && lstPSSID.SelectedItem.Value.Length > 0)
            {
                strSearch += string.Format(" AND A.PSSID='{0}'", lstPSSID.SelectedItem.Value);
            }
            //过滤新单的单据,不能审核,提交后的才能审核
            if (Request.QueryString["oper"].ToString() == "audit")
            {
                strSearch += " AND A.FLAG<>'M'";
            }
            //  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.THRQ>=TO_DATE('{0}','YYYY-MM-DD')", lstLRRQ1.Text);
            strSearch += string.Format(" AND A.THRQ <TO_DATE('{0}','YYYY-MM-DD') + 1", lstLRRQ2.Text);

            if (!string.IsNullOrWhiteSpace(strSearch))
            {
                strSql += strSearch;
            }
            strSql += " ORDER BY A.BILLNO DESC";
            GridList.DataSource = DbHelperOra.Query(strSql).Tables[0];
            GridList.DataBind();
        }
コード例 #26
0
        protected override void billSearch()
        {
            if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null)
            {
                Alert.Show("请输入条件【结算日期】!");
                return;
            }

            string strSql    = @"select 
                                CUSTID,SEQNO,DEPTID,F_GETDEPTNAME(DEPTID) DEPTIDNAME,SUPID,SUPNAME,FLAG,decode(FLAG,'Y','已结算','G','已付款','R','驳回','未结算') FLAGNAME,GATFUNDCORP,GATFUNDBANK,GATACCNTNO,LINKMAN,LINKTEL,
                                CWLINKMAN,CWLINKTEL,BEGRQ,ENDRQ,SYJE,XSJE,THJE,JSJE,FPJE,FPHM,LRY,LRRQ,SPR,SPRQ,SHR,WJJE,YJJJ,JSJE,WJJE,
                                SHRQ,MEMO,STR1,STR2,STR3,NUM1,NUM2,NUM3,UPTTIME     
                                from dat_jsd_doc 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 ((BEGRQ between TO_DATE('{0}','YYYY-MM-DD') and (TO_DATE('{1}','YYYY-MM-DD')) + 1) or (ENDRQ 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 DEPTID,ENDRQ DESC";
            highlightRows.Text = "";
            DataTable dtBill = new DataTable();

            dtBill = DbHelperOra.Query(strSql).Tables[0];
            GridList.DataSource = dtBill;
            GridList.DataBind();
            //计算合计数量
            decimal ddslTotal = 0, bzslTotal = 0, feTotal = 0, feeTotal = 0;

            foreach (DataRow row in dtBill.Rows)
            {
                ddslTotal += Convert.ToDecimal(row["SYJE"]);
                bzslTotal += Convert.ToDecimal(row["XSJE"]);
                feeTotal  += Convert.ToDecimal(row["THJE"]);
                feTotal   += Convert.ToDecimal(row["YJJJ"]);
            }
            JObject summary = new JObject();

            summary.Add("FLAGNAME", "本页合计");
            summary.Add("SYJE", ddslTotal.ToString("F2"));
            summary.Add("XSJE", bzslTotal.ToString("F2"));
            summary.Add("THJE", feeTotal.ToString("F2"));
            summary.Add("YJJJ", feTotal.ToString("F2"));
            GridList.SummaryData = summary;
        }
コード例 #27
0
    void BindGrid()
    {
        List <Excellent> exs = Excellent.Excellents.FindAll(
            delegate(Excellent e)
        {
            return(e.IsPublished == true);
        });

        GridList.DataSource = exs;
        GridList.DataBind();
    }
コード例 #28
0
        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,F_GETDEPTNAME(A.DEPTID) DEPTID,A.XSRQ,F_GETDEPTNAME(A.DEPTOUT) DEPTOUT,A.SUBSUM,
                                     A.SUBNUM,F_GETUSERNAME(A.SLR) SLR,F_GETUSERNAME(A.LRY) LRY,A.LRRQ,A.SHR,A.SHRQ,A.MEMO 
                                from DAT_CK_DOC A, SYS_CODEVALUE B 
                                WHERE A.FLAG = B.CODE AND B.TYPE  ='DIC_BILLSTATUS' AND BILLTYPE='DSC' AND XSTYPE='1' ";
            string strSearch = "";


            if (lstBILLNO.Text.Length > 0)
            {
                strSearch += string.Format(" AND A.BILLNO  LIKE '%{0}%'", lstBILLNO.Text);
            }
            if (lstFLAG.SelectedValue.Length > 0)
            {
                strSearch += string.Format(" AND A.FLAG='{0}'", lstFLAG.SelectedItem.Value);
            }
            if (lstSLR.SelectedValue.Length > 0)
            {
                strSearch += string.Format(" AND A.SLR='{0}'", lstSLR.SelectedItem.Value);
            }
            if (lstDEPTID.SelectedValue.Length > 0)
            {
                strSearch += string.Format(" AND A.DEPTID='{0}'", lstDEPTID.SelectedItem.Value);
            }
            if (lstDEPTOUT.SelectedValue.Length > 0)
            {
                strSearch += string.Format(" AND DEPTOUT='{0}'", lstDEPTOUT.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 B.NAME,A.BILLNO DESC";
            highlightRows.Text  = "";
            GridList.DataSource = DbHelperOra.Query(strSql).Tables[0];
            GridList.DataBind();
        }
コード例 #29
0
ファイル: Settlement.aspx.cs プロジェクト: cjllove/ERP
        protected override void billSearch()
        {
            if (lstLRRQ1.SelectedDate == null || lstLRRQ2.SelectedDate == null)
            {
                Alert.Show("请输入条件【结算日期】!");
                return;
            }

            string strSql    = @"SELECT 
                                CUSTID,SEQNO,DEPTID,F_GETDEPTNAME(DEPTID) DEPTIDNAME,SUPID,SUPNAME,FLAG,DECODE(FLAG,'Y','已审核','G','已付款','R','驳回','未结算') FLAGNAME,GATFUNDCORP,GATFUNDBANK,GATACCNTNO,LINKMAN,LINKTEL,
                                CWLINKMAN,CWLINKTEL,BEGRQ,ENDRQ,NVL(SYJE,0) SYJE,NVL(XSJE,0) XSJE,NVL(THJE,0) THJE,NVL(JSJE,0) JSJE,FPJE,FPHM,LRY,LRRQ,SPR,SPRQ,SHR,NVL(YJJJ,0) YJJJ,JSJE,WJJE,
                                SHRQ,MEMO,STR1,STR2,STR3,NUM1,NUM2,NUM3,UPTTIME     
                                FROM DAT_JSD_DOC WHERE SEQNO IN (SELECT DISTINCT SEQNO FROM DAT_JSD_COM) ";
            string strSearch = "";

            if (lstBILLNO.Text.Length > 0)
            {
                strSearch += string.Format(" AND SEQNO  = '{0}'", lstBILLNO.Text);
            }
            if (lstSUPID.SelectedItem.Value.Length > 0)
            {
                strSearch += string.Format(" AND SUPID='{0}'", lstSUPID.SelectedItem.Value);
            }
            strSearch += string.Format(" AND ((BEGRQ BETWEEN TO_DATE('{0}','YYYY-MM-DD') AND (TO_DATE('{1}','YYYY-MM-DD')) + 1) OR (ENDRQ 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 DEPTID,ENDRQ DESC";
            DataTable dtBill = new DataTable();

            dtBill = DbHelperOra.Query(strSql).Tables[0];
            GridList.DataSource = dtBill;
            GridList.DataBind();
            //计算合计数量
            decimal ddslTotal = 0, bzslTotal = 0, feTotal = 0, feeTotal = 0;

            foreach (DataRow row in dtBill.Rows)
            {
                ddslTotal += Convert.ToDecimal(row["SYJE"]);
                bzslTotal += Convert.ToDecimal(row["XSJE"]);
                feeTotal  += Convert.ToDecimal(row["THJE"]);
                feTotal   += Convert.ToDecimal(row["YJJJ"]);
            }
            JObject summary = new JObject();

            summary.Add("FLAGNAME", "本页合计");
            summary.Add("SYJE", ddslTotal.ToString("F2"));
            summary.Add("XSJE", bzslTotal.ToString("F2"));
            summary.Add("THJE", feeTotal.ToString("F2"));
            summary.Add("YJJJ", feTotal.ToString("F2"));
            GridList.SummaryData = summary;
        }
コード例 #30
0
        private void bntSearch_Click()
        {
            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,A.DDBH,F_GETDEPTNAME(A.DEPTID) DEPTID,A.SUPNAME,A.DHRQ,
                                     A.SUBSUM,F_GETUSERNAME(A.CGY) CGY,F_GETUSERNAME(A.LRY) LRY,A.LRRQ,A.SHR,A.SHRQ,A.MEMO 
                                from DAT_RK_DOC A,
                                     SYS_CODEVALUE B 
                                WHERE A.FLAG = B.CODE AND B.TYPE  ='DIC_BILLSTATUS' ";
            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);
            }

            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;
            }

            GridList.DataSource = DbHelperOra.Query(strSql).Tables[0];
            GridList.DataBind();
        }