Example #1
0
        //数据绑定
        public void SearData(int pageIndex)
        {
            int allRecordCount;
            List <IDataItem> list = this.GetControlValue();
            //if (this.WorkUser.UserType == UserType.建设单位)
            //{
            //    WebCommon.AddDataItem(list, "BuildCorpCode", this.WorkUser.LoginName);
            //}
            //if (this.WorkUser.UserType == UserType.施工单位)
            //{
            //    WebCommon.AddDataItem(list, "dwlx", "施工单位");
            //    WebCommon.AddDataItem(list, "dwdm", this.WorkUser.LoginName);
            //}

            DataTable dt = new DataTable();

            if (bIsBeFrom)
            {
                WebCommon.AddDataItem(list, "PrjNum", PrjNum);
                dt = gcxmBll.GetZlbjxx(list, this.gridView.PageSize, "sbrq desc", pageIndex, out allRecordCount).Result;
            }
            else
            {
                dt = gcxmBll.GetZlbjxx(list, this.gridView.PageSize, "sbrq desc", pageIndex, out allRecordCount).Result;
            }
            this.gridView.RecordCount = allRecordCount;
            this.gridView.PageIndex   = pageIndex;
            this.gridView.DataSource  = dt;
            this.gridView.DataBind();
        }
Example #2
0
        public void SearchData(int pageIndex)
        {
            int allRecordCount;
            List <IDataItem> list = this.GetControlValue();

            WebCommon.AddDataItem(list, "apiFlow", apiFlow);

            DataTable dt = xxgxBll.RetrieveApiCb(list, this.gridView.PageSize, pageIndex, "apiDyTime desc", out allRecordCount);

            this.gridView.RecordCount = allRecordCount;
            this.gridView.PageIndex   = pageIndex;
            this.gridView.DataSource  = dt;
            this.gridView.DataBind();
        }
Example #3
0
        //数据绑定
        public void SearData(int pageIndex)
        {
            string ssdq = "";
            string zzlb = "";

            foreach (ListItem item in this.cbl_ssdq.Items)
            {
                if (item.Selected)
                {
                    ssdq += item.Text + ",";
                }
            }
            ssdq = ssdq.Trim(',');

            foreach (ListItem item in this.cbl_zzlb.Items)
            {
                if (item.Selected)
                {
                    zzlb += item.Text + ",";
                }
            }
            zzlb = zzlb.Trim(',');

            int allRecordCount;
            List <IDataItem> list = this.GetControlValue();

            //WebCommon.AddDataItem(list, "zzjgdm", this.WorkUser.LoginName);

            if (!string.IsNullOrEmpty(ssdq))
            {
                WebCommon.AddDataItem(list, "qysd", ssdq);
            }

            if (!string.IsNullOrEmpty(zzlb))
            {
                WebCommon.AddDataItem(list, "zzlb", zzlb);
            }


            DataTable dt = new DataTable();

            dt = xytxBll.RetrieveQyxykp(list, this.gridView.PageSize, pageIndex, "kpnd desc", out allRecordCount).Result;

            this.gridView.RecordCount = allRecordCount;
            this.gridView.PageIndex   = pageIndex;
            this.gridView.DataSource  = dt;
            this.gridView.DataBind();
        }
Example #4
0
        //数据绑定
        public void SearData(int pageIndex)
        {
            string tblb = "";

            foreach (ListItem item in this.cbl_Htlb.Items)
            {
                if (item.Selected)
                {
                    tblb += item.Value + ",";
                }
            }
            tblb = tblb.Trim(',');

            int allRecordCount;
            List <IDataItem> list = this.GetControlValue();
            //if (this.WorkUser.UserType == UserType.建设单位)
            //{
            //    WebCommon.AddDataItem(list, "BuildCorpCode", this.WorkUser.LoginName);
            //}
            //if (this.WorkUser.UserType == UserType.施工单位)
            //{
            //    WebCommon.AddDataItem(list, "ContractorCorpCode", this.WorkUser.LoginName);
            //}



            DataTable dt = new DataTable();

            if (bIsBeFrom)
            {
                WebCommon.AddDataItem(list, "PrjNum", PrjNum);
                dt = gcxmBll.GetHtba(list, tblb, this.gridView.PageSize, "  ContractDate desc ", pageIndex, out allRecordCount).Result;
            }
            else
            {
                dt = gcxmBll.GetHtba(list, tblb, this.gridView.PageSize, "ContractDate desc ", pageIndex, out allRecordCount).Result;
            }
            this.gridView.RecordCount = allRecordCount;
            this.gridView.PageIndex   = pageIndex;
            this.gridView.DataSource  = dt;
            this.gridView.DataBind();
        }
Example #5
0
        protected void btn_send_Click(object sender, EventArgs e)
        {
            string msg = this.CheckControlValue();

            if (!string.IsNullOrEmpty(msg))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('" + msg + "');", true);
                return;
            }
            if (string.IsNullOrEmpty(this.txtReceiverIds.Text.Trim(',')) && string.IsNullOrEmpty(this.db_newSxr.Text.Trim().Trim(',')))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('请选择或输入收信人!');", true);
                return;
            }

            List <IDataItem> list   = this.GetControlValue();
            string           sxrIds = "";
            DataTable        dt     = BLL.RetrieveDxjb_AllSxr_List().Result;

            foreach (string s in this.txtReceiverIds.Text.Trim().Trim(',').Split(','))
            {
                if (!string.IsNullOrEmpty(s))
                {
                    DataRow[] rows = dt.Select("SjmlID=" + s);
                    if (rows != null && rows.Length > 0)
                    {
                        if (!string.IsNullOrEmpty(rows[0]["sjmlMobile"].ToString2().Trim()))
                        {
                            sxrIds += rows[0]["sjmlMobile"].ToString2().Trim() + ",";
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('\"" + rows[0]["SjmlName"] + "\"收信人号码为空,无法发送短信!');", true);
                            return;
                        }
                    }
                }
            }
            string sxr = this.db_fsdx.Text.Trim().Trim(',');

            string[] mobiles;
            if (!string.IsNullOrEmpty(this.db_newSxr.Text.Trim().Trim(new char[','])))
            {
                mobiles = this.db_newSxr.Text.Trim().Trim(',').Split(',');

                if (mobiles != null && mobiles.Length > 0)
                {
                    foreach (var item in mobiles)
                    {
                        if (!string.IsNullOrEmpty(item))
                        {
                            sxrIds += item + ",";
                        }
                        if (string.IsNullOrEmpty(sxr))
                        {
                            sxr += "【" + item + "】";
                        }
                        else
                        {
                            sxr += ",【" + item + "】";
                        }
                    }
                }
            }
            if (string.IsNullOrEmpty(sxrIds.Trim(',')))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('收信人号码为空!');", true);
                return;
            }
            WebCommon.AddDataItem(list, "SxrNumbers", sxrIds.Trim(','));

            WebCommon.AddDataItem(list, "Jbmc", this.db_Jbmc.Text);
            WebCommon.AddDataItem(list, "Jbnr", this.db_Jbnr.Text);
            WebCommon.AddDataItem(list, "EveryWeekOne", "0");
            WebCommon.AddDataItem(list, "IsDsfs", "False");
            WebCommon.AddDataItem(list, "EveryWeekOne", "0");
            WebCommon.AddDataItem(list, "EveryMonthOne", "0");
            WebCommon.AddDataItem(list, "EveryQuarterOne", "0");
            WebCommon.AddDataItem(list, "Sxr", sxr);

            //WebCommon.AddDataItem(list, "UserID", this.WorkUser.UserID);
            //WebCommon.AddDataItem(list, "Fxr", this.WorkUser.UserName);
            //WebCommon.AddDataItem(list, "SendTime", DateTime.Now.ToString());
            string errorPhone          = "";
            FunctionResult <string> fr = BLL.SendDxjb(this.ddl_yzjb.SelectedValue, list, out errorPhone);

            if (fr.Status != FunctionResultStatus.Error)
            {
                if (string.IsNullOrEmpty(errorPhone))
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "SaveResult('" + fr.Result + "');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "ShowWarnResult('" + fr.Result + "');", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('" + fr.Result + "');", true);
            }
        }
Example #6
0
        protected void btn_send_Click(object sender, EventArgs e)
        {
            string msg = this.CheckControlValue();

            if (!string.IsNullOrEmpty(msg))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('" + msg + "');", true);
                return;
            }
            if (this.db_IsDsfs.Checked &&
                string.IsNullOrEmpty(this.txtReceiverIds.Text.Trim(new char[] { ',' })) && string.IsNullOrEmpty(this.db_newSxr.Text.Trim().Trim(',')))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('您设置为定时发送,请选择或输入收信人!');", true);
                return;
            }
            //if (this.db_IsDsfs.Checked&&string.IsNullOrEmpty(this.db_fxr.Text))
            //{
            //    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('请选择发信人!');", true);
            //    return;
            //}

            List <SqlPara> sqls = WebCommon.ConvertSql(this.db_Jbnr.Text);

            if (sqls != null && sqls.Count > 0)
            {
                foreach (SqlPara item in sqls)
                {
                    try
                    {
                        BLL.ExecuteSql(item.executeSql);
                    }
                    catch (Exception ex)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn(\"保存失败,可执行sql脚本有错误!<br/>" + ex.Message.Trim('\'').Trim('"') + "\");", true);
                        return;
                    }
                }
            }

            List <IDataItem> list = this.GetControlValue();

            if (this.db_IsDsfs.Checked)
            {
                if (this.db_dsfs_1.Checked)
                {
                    WebCommon.AddDataItem(list, "EveryWeekOne", "1");
                    WebCommon.AddDataItem(list, "EveryMonthOne", "0");
                    WebCommon.AddDataItem(list, "EveryQuarterOne", "0");
                }
                else
                if (this.db_dsfs_2.Checked)
                {
                    WebCommon.AddDataItem(list, "EveryWeekOne", "0");
                    WebCommon.AddDataItem(list, "EveryMonthOne", "1");
                    WebCommon.AddDataItem(list, "EveryQuarterOne", "0");
                }
                else
                if (this.db_dsfs_3.Checked)
                {
                    WebCommon.AddDataItem(list, "EveryWeekOne", "0");
                    WebCommon.AddDataItem(list, "EveryMonthOne", "0");
                    WebCommon.AddDataItem(list, "EveryQuarterOne", "1");
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('请选择一种自动发送类型!');", true);
                    return;
                }
            }
            else
            {
                WebCommon.AddDataItem(list, "EveryWeekOne", "0");
                WebCommon.AddDataItem(list, "EveryMonthOne", "0");
                WebCommon.AddDataItem(list, "EveryQuarterOne", "0");
            }

            WebCommon.AddDataItem(list, "sxrIds", this.txtReceiverIds.Text.Trim(new char[] { ',' }));
            WebCommon.AddDataItem(list, "UserID", "");
            WebCommon.AddDataItem(list, "Fxr", "");

            if (Operate == OperateSt.add.ToString())
            {
                FunctionResult <string> fr = BLL.SaveDxjb(list);
                if (fr.Status != FunctionResultStatus.Error)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "SaveResult('" + fr.Result + "');", true);
                    return;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('" + fr.Result + "');", true);
                    return;
                }
            }
            else
            {
                FunctionResult <string> fr = BLL.SaveDxjb(DxjbId, list);
                if (fr.Status != FunctionResultStatus.Error)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "SaveResult('" + fr.Result + "');", true);
                    return;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "showWarn('" + fr.Result + "');", true);
                    return;
                }
            }
        }