Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.reportid = base.Request.QueryString["reportid"];
         this.sta      = 0;
         DataRow reportRow = QueryItemAction.GetReportRow(this.reportid);
         this.Lb_Title.Text = reportRow["Title"].ToString();
         int    n    = Convert.ToInt32(reportRow["headwidth"].ToString());
         string text = reportRow["Header"].ToString().Replace("[getdate()]", DateTime.Now.ToLongDateString());
         text = text.Replace("[yhmc]", com.jwsoft.pm.entpm.PageHelper.QueryUser(this, this.Session["yhdm"].ToString()));
         string[] array = text.Split(new char[]
         {
             ';'
         });
         try
         {
             this.Lb_H1.Text = array[0];
             this.Lb_H2.Text = array[1];
             this.Lb_H3.Text = array[2];
         }
         catch
         {
         }
         string text2 = reportRow["Footer"].ToString().Replace("[getdate()]", DateTime.Now.ToLongDateString());
         text2 = text2.Replace("[yhmc]", com.jwsoft.pm.entpm.PageHelper.QueryUser(this, this.Session["yhdm"].ToString()));
         string[] array2 = text2.Split(new char[]
         {
             ';'
         });
         try
         {
             this.Lb_F1.Text = array2[0];
             this.Lb_F2.Text = array2[1];
             this.Lb_F3.Text = array2[2];
         }
         catch
         {
         }
         if (this.Lb_Title.Text.Trim() == "")
         {
             this.TRTitle.Visible = false;
         }
         this.DG1.Width = n;
         if (this.Lb_F1.Text.Trim() == "" && this.Lb_F2.Text.Trim() == "" && this.Lb_F3.Text.Trim() == "")
         {
             this.TrFooter.Visible = false;
         }
         if (this.Lb_H1.Text.Trim() == "" && this.Lb_H2.Text.Trim() == "" && this.Lb_H3.Text.Trim() == "")
         {
             this.TrHeader.Visible = false;
         }
         this.btnSet.Attributes["onclick"] = "if (!openQuery(" + this.reportid + ")){return false;}";
         this.Session["QUERY"]             = null;
         this.DG1_BIND(" where (1=1)");
     }
 }
Exemplo n.º 2
0
    public void DG1_BIND(string strWhere, string selectlist)
    {
        if (strWhere == "")
        {
            strWhere = "   where (1=0)";
        }
        DataTable reportLister = QueryItemAction.GetReportLister(this.reportid, strWhere, selectlist);

        this.DG1.DataSource = reportLister;
        this.DG1.DataBind();
    }
Exemplo n.º 3
0
    public void DG1_BIND(string strWhere)
    {
        if (strWhere == "")
        {
            strWhere = "   where (1=0)";
        }
        DataTable reportList = QueryItemAction.GetReportList(this.reportid, strWhere);

        if (reportList.Rows.Count != 0)
        {
            if (reportList.Columns.Contains("合同金额"))
            {
                if (!string.IsNullOrEmpty(reportList.Compute("sum(合同金额)", "").ToString()))
                {
                    this.Lb_ContractAccount.Text = "合同金额总计:" + Convert.ToDouble(reportList.Compute("sum(合同金额)", "").ToString());
                }
                else
                {
                    this.Lb_ContractAccount.Text = "合同金额总计:0.000";
                }
            }
            if (reportList.Columns.Contains("结算金额"))
            {
                if (!string.IsNullOrEmpty(reportList.Compute("sum(结算金额)", "").ToString()))
                {
                    this.Lb_jiesuan.Text = "结算金额总计:" + Convert.ToDouble(reportList.Compute("sum(结算金额)", "").ToString());
                }
                else
                {
                    this.Lb_jiesuan.Text = "结算金额总计:0.000";
                }
            }
            if (reportList.Columns.Contains("累计支付金额"))
            {
                if (!string.IsNullOrEmpty(reportList.Compute("sum(累计支付金额)", "").ToString()))
                {
                    this.Lb_Leiji.Text = "累计支付金额总计:" + Convert.ToDouble(reportList.Compute("sum(累计支付金额)", ""));
                }
                else
                {
                    this.Lb_Leiji.Text = "累计支付金额总计:0.000";
                }
            }
        }
        else
        {
            this.Lb_ContractAccount.Text = "合同金额总计:0.000";
            this.Lb_jiesuan.Text         = "结算金额总计:0.000";
            this.Lb_Leiji.Text           = "累计支付金额总计:0.000";
        }
        this.DG1.DataSource = reportList;
        this.DG1.DataBind();
    }
Exemplo n.º 4
0
 private void dgdOrder_Bind(string strWhere)
 {
     if (strWhere != "")
     {
         DataTable reportPList = QueryItemAction.GetReportPList(this.reportid, strWhere);
         this.dgdOrder.DataSource = QueryItemAction.GetReportPList(this.reportid, strWhere);
         if (reportPList.Rows.Count <= 0)
         {
             return;
         }
         this.dgdOrder.DataBind();
     }
 }
Exemplo n.º 5
0
    public void DG1_BIND(string strWhere)
    {
        DataTable reportList = QueryItemAction.GetReportList(this.reportid, strWhere);

        if (reportList.Columns.Contains("小计"))
        {
            if (reportList.Rows.Count != 0)
            {
                this.Label1.Text = "总计:" + Convert.ToDouble(reportList.Compute("sum(小计)", "").ToString());
            }
            else
            {
                this.Label1.Text = "总计:0.00";
            }
        }
        this.DG1.DataSource = reportList;
        this.DG1.DataBind();
    }
Exemplo n.º 6
0
    protected void btnexecl_Click(object sender, EventArgs e)
    {
        string text = "   where (1=1) ";

        if (this.Session["QUERY"] != null)
        {
            QueryItemCollection queryItemCollection = (QueryItemCollection)this.Session["QUERY"];
            for (int i = 0; i < queryItemCollection.Count; i++)
            {
                if (queryItemCollection[i].ItemValue.Trim() != "")
                {
                    text = text + "   and " + queryItemCollection[i].StrSql.Replace("[]", queryItemCollection[i].ItemValue.Trim()).Trim();
                }
            }
        }
        DataTable reportList = QueryItemAction.GetReportList(this.reportid, text);

        this.ExportToExecelAll(reportList, this.Lb_Title.Text + ".xls");
    }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.ReportID = 1;
         this.Options  = QueryItemAction.QueryValidItems(this.ReportID);
         QueryItem queryItem = new QueryItem();
         queryItem.ItemName  = "";
         queryItem.ItemValue = "";
         queryItem.Join      = JoinType.And;
         queryItem.Operator  = "";
         this.ItemList       = new QueryItemCollection
         {
             queryItem
         };
         this.dgdQuery_Bind();
         this.dgdQuery_Disable();
     }
 }
Exemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.ReportID = Convert.ToInt32(base.Request["reportid"]);
         this.Options  = QueryItemAction.QueryValidItems(this.ReportID);
         QueryItemCollection queryItemCollection = new QueryItemCollection();
         for (int i = 0; i < this.Options.Rows.Count; i++)
         {
             queryItemCollection.Add(new QueryItem
             {
                 ItemName  = this.Options.Rows[i]["TermName"].ToString(),
                 ItemSign  = "",
                 ItemValue = "",
                 StrSql    = this.Options.Rows[i]["StrSql"].ToString(),
                 ToolTip   = this.Options.Rows[i]["ToolTip"].ToString(),
                 DataType  = (int)this.Options.Rows[i]["DataType"],
                 IsEmpty   = (bool)this.Options.Rows[i]["IsEmpty"]
             });
         }
         this.ItemList = queryItemCollection;
         this.dgdQuery_Bind();
     }
 }
Exemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.reportid = base.Request.QueryString["reportid"];
         DataRow reportRow = QueryItemAction.GetReportRow(this.reportid);
         string  text      = base.Request["type"].ToString();
         string  text2     = "";
         string  a;
         if ((a = text) != null)
         {
             if (!(a == "1"))
             {
                 if (!(a == "2"))
                 {
                     if (!(a == "3"))
                     {
                         if (!(a == "4"))
                         {
                             if (a == "5")
                             {
                                 text2 = "其他";
                             }
                         }
                         else
                         {
                             text2 = "租赁";
                         }
                     }
                     else
                     {
                         text2 = "采购";
                     }
                 }
                 else
                 {
                     text2 = "分包";
                 }
             }
             else
             {
                 text2 = "承包";
             }
         }
         this.Lb_Title.Text = text2 + reportRow["Title"].ToString();
         int    n     = Convert.ToInt32(reportRow["headwidth"].ToString());
         string text3 = reportRow["Header"].ToString().Replace("[getdate()]", DateTime.Now.ToLongDateString());
         text3 = text3.Replace("[yhmc]", com.jwsoft.pm.entpm.PageHelper.QueryUser(this, this.Session["yhdm"].ToString()));
         string[] array = text3.Split(new char[]
         {
             ';'
         });
         try
         {
             this.Lb_H1.Text = array[0];
             this.Lb_H2.Text = array[1];
             this.Lb_H3.Text = array[2];
         }
         catch
         {
         }
         string text4 = reportRow["Footer"].ToString().Replace("[getdate()]", DateTime.Now.ToLongDateString());
         text4 = text4.Replace("[yhmc]", com.jwsoft.pm.entpm.PageHelper.QueryUser(this, this.Session["yhdm"].ToString()));
         string[] array2 = text4.Split(new char[]
         {
             ';'
         });
         try
         {
             this.Lb_F1.Text = array2[0];
             this.Lb_F2.Text = array2[1];
             this.Lb_F3.Text = array2[2];
         }
         catch
         {
         }
         if (this.Lb_Title.Text.Trim() == "")
         {
             this.TRTitle.Visible = false;
         }
         this.DG1.Width = n;
         if (this.Lb_F1.Text.Trim() == "" && this.Lb_F2.Text.Trim() == "" && this.Lb_F3.Text.Trim() == "")
         {
             this.TrFooter.Visible = false;
         }
         if (this.Lb_H1.Text.Trim() == "" && this.Lb_H2.Text.Trim() == "" && this.Lb_H3.Text.Trim() == "")
         {
             this.TrHeader.Visible = false;
         }
         this.btnSet.Attributes["onclick"] = "if (!openQuery(" + this.reportid + ")){return false;}";
         string text5 = " where (1=1) ";
         if (text2.Trim() != "")
         {
             text5 = text5 + "  and 合同类型 like '" + text2 + "合同' ";
         }
         this.DG1_BIND(text5);
     }
 }