Esempio n. 1
0
 protected void btnExcel_ServerClick(object sender, System.EventArgs e)
 {
     if (hidSelectedFields.Value != "")
     {
         oListPage.GenerateExcelGrid_SelectColumns(this.lblTableName.Text,
                                                   "",
                                                   "",
                                                   0,
                                                   hidSelectedFields.Value
                                                   );
     }
     else
     {
         this.AlertAjaxMessage("请选择导出的字段!");
     }
 }
Esempio n. 2
0
        protected void btnTest_ServerClick(object sender, System.EventArgs e)
        {
            if (hidSelectedFields.Value != "")
            {
                string str = " and s_Pro_Type='企业类'";

                if (s_xiangMuJL.Text != "")
                {
                    str += " and s_xiangMuJL like '%" + this.s_xiangMuJL.Text.Replace("'", "''").Replace("_", "\\_").Replace("%", "\\%") + "%'";
                }

                if (s_xiangMuMC.Text != "")
                {
                    str += " and s_xiangMuMC like '%" + this.s_xiangMuMC.Text.Replace("'", "''").Replace("_", "\\_").Replace("%", "\\%") + "%'";
                }

                if (s_xiangMuGSQC.Text != "")
                {
                    str += " and s_xiangMuGSQC like '%" + this.s_xiangMuGSQC.Text.Replace("'", "''").Replace("_", "\\_").Replace("%", "\\%") + "%'";
                }

                if (this.s_xiangmuBH.Text.Trim() != "")
                {
                    str += " and s_xiangmuBH like '%" + this.s_xiangmuBH.Text.Trim().Replace("'", "''").Replace("_", "\\_").Replace("%", "\\%") + "%'";
                }

                if (s_LiXiangSQR.Text != "")
                {
                    str += " and s_LiXiangSQR like '%" + this.s_LiXiangSQR.Text.Replace("'", "''").Replace("_", "\\_").Replace("%", "\\%") + "%'";
                }

                if (s_dengJiR.Text != "")
                {
                    str += " and s_dengJiR like '%" + this.s_dengJiR.Text.Replace("'", "''").Replace("_", "\\_").Replace("%", "\\%") + "%'";
                }

                if (this.d_dengJiRQ.FromText.ToString() != "")
                {
                    str += " and d_dengJiRQ>'" + DateTime.Parse(this.d_dengJiRQ.FromText.ToString()).AddDays(-1) + "'";
                }
                if (this.d_dengJiRQ.ToText.ToString() != "")
                {
                    str += " and d_dengJiRQ<'" + DateTime.Parse(this.d_dengJiRQ.ToText.ToString()).AddDays(1) + "'";
                }
                if (this.s_suoShuHY.Text.ToString() != "")
                {
                    str += " and s_suoShuHY='" + this.s_suoShuHY.Text.ToString() + "'";
                }
                if (this.s_xiangMuLY.SelectedValue.ToString() != "")
                {
                    str += " and s_xiangMuLY_Drop=" + this.s_xiangMuLY.SelectedValue.ToString();
                }
                if (this.s_GuanLiPT.SelectedValue.ToString() != "")
                {
                    string GuanLiPT = rtn_GuanLiPT();

                    str += " and s_guanLiPT in (" + GuanLiPT + ")";
                }
                if (this.s_xiangMuZT.SelectedValue.ToString() != "")
                {
                    string xiangMuZTList = rtn_xiangMuZT();

                    str += " and s_xiangMuZT in (" + xiangMuZTList + ")";
                }
                str += " and (s_del_TrueOrFalse is Null or s_del_TrueOrFalse='')";

                string GuanLiPT_All = rtn_GuanLiPT_ForAll();

                str += " and s_guanLiPT in (" + GuanLiPT_All + ")";
                //版本控制
                str += " and VersionGuid in ( select distinct VersionGuid from SVG_Pro_Version where IsCurrentVersion = 1  ) ";
                //获取判断条件
                oListPage.OtherCondition = str;
                oListPage.GenerateExcelGrid_SelectColumns(this.lblTableName.Text,
                                                          "",
                                                          "",
                                                          0,
                                                          hidSelectedFields.Value
                                                          );
            }
            else
            {
                this.AlertAjaxMessage("请选择导出的字段!");
            }
        }