예제 #1
0
        protected void Page_Load(object seder, EventArgs e)
        {
            PkId = Request.QueryString["pkid"];
            BLL  = new XmxxBLL(WorkUser);

            if (!this.IsPostBack)
            {
                WebCommon.DropDownListDataBind(this.ddl_sbdqbm, "Xzqdm", true);
                if (!WorkUser.list.Exists(p => p.moduleCode.Equals(ModuleCode_Enum.zjxx.ToString(), StringComparison.CurrentCultureIgnoreCase)))
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myScript", "showWarn('您没有权限进行此操作!');", true);
                    return;
                }

                FunctionResult <DataTable> result = BLL.Read_zj_gcjbxx_zrdw(PkId);

                if (result.Status != FunctionResultStatus.Error)
                {
                    if (result.Result.Rows.Count > 0)
                    {
                        List <IDataItem> list = result.Result.Rows[0].ToDataItem();
                        this.SetControlValue(list);
                    }
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myScript", "showError('" + result.Message.Message + "');", true);
                    return;
                }
            }
        }
예제 #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int     allRecordCount = 0;
            string  sortname       = context.Request.Params["sortname"];
            string  sortorder      = context.Request.Params["sortorder"];
            int     page           = Convert.ToInt32(context.Request.Params["page"]) - 1; // 系统的索引从0开始,所以此处需要减1
            int     pagesize       = Convert.ToInt32(context.Request.Params["pagesize"]);
            string  fromWhere      = context.Request.QueryString["fromwhere"];
            string  rowid          = context.Request.QueryString["rowid"];
            object  sessionAppUser = context.Session[ConfigManager.GetSignInAppUserSessionName()];
            AppUser workUser       = (AppUser)sessionAppUser;

            xmxxBLL = new XmxxBLL(workUser);

            //排序
            string orderby = @" " + sortname + " " + sortorder + " ";
            //通过检索翻译 生成查询条件
            FilterTranslator ft = ContextExtension.GetGridData(context);
            //分页
            DataTable dt   = new DataTable();
            string    json = String.Empty;

            switch (fromWhere)
            {
            case "ajxxList":
                dt = xmxxBLL.RetrieveAjxxList(ft, pagesize, page, orderby, out allRecordCount);
                break;


            case "zjxxList":
                dt = xmxxBLL.RetrieveZjxxList(ft, pagesize, page, orderby, out allRecordCount);
                break;

            case "ajxx_ryxxList":
                string aqjdbm = context.Request.QueryString["aqjdbm"];
                dt = xmxxBLL.RetrieveAjxx_RyxxList(aqjdbm, ft, pagesize, page, orderby, out allRecordCount);
                break;

            case "zjxx_ryxxList":
                string zljdbm = context.Request.QueryString["zljdbm"];
                dt = xmxxBLL.RetrieveZjxx_RyxxList(zljdbm, ft, pagesize, page, orderby, out allRecordCount);
                break;

            case "lxxmList":
                dt = xmxxBLL.RetrieveLxxmList(ft, pagesize, page, orderby, out allRecordCount);
                break;
            }
            ft.Parms.Clear();

            string result = JSONHelper.DataTableToJson(dt);

            //result = Regex.Replace(result, @"[/n/r]", ""); //去掉字符串里所有换行符
            //result = result.TrimEnd((char[])"\n\r".ToCharArray());  //去掉换行符
            json = @"{""Rows"":[" + result + @"],""Total"":""" + allRecordCount + @"""}";
            context.Response.Write(json);
            context.Response.End();
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BLL     = new XmxxBLL(WorkUser);
            Operate = Request.QueryString["operate"];
            PkId    = Request.QueryString["pkid"];

            if (!this.IsPostBack)
            {
                if (!WorkUser.list.Exists(p => p.moduleCode.Equals(ModuleCode_Enum.ajxx.ToString(), StringComparison.CurrentCultureIgnoreCase) && p.operateCode.Equals(Ajxx_Operate.CreateOrEdit.ToString())))
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myScript", "showWarn('您没有权限进行此操作!');", true);
                    return;
                }

                WebCommon.DropDownListDataBind(this.ddl_gcgk_jglx, "PrjStructureType", true);
                if (Operate.Equals("edit", StringComparison.CurrentCultureIgnoreCase))
                {
                    this.btnSelectLxxm.Visible = false;
                    FunctionResult <DataTable> result = BLL.Read_aj_gcjbxx(PkId);

                    if (result.Status != FunctionResultStatus.Error)
                    {
                        if (result.Result.Rows.Count > 0)
                        {
                            List <IDataItem> list = result.Result.Rows[0].ToDataItem();
                            this.SetControlValue(list);

                            result = BLL.Read_TBProjectInfo(list.GetDataItem("PrjNum").ItemData);

                            if (result.Status != FunctionResultStatus.Error)
                            {
                                if (result.Result.Rows.Count > 0)
                                {
                                    list = result.Result.Rows[0].ToDataItem();
                                    this.SetControlValue(list);
                                }
                            }
                            else
                            {
                                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myScript", "showError('" + result.Message.Message + "');", true);
                                return;
                            }
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myScript", "showError('" + result.Message.Message + "');", true);
                        return;
                    }
                }
            }
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string pkid = Request.QueryString["PKID"];

            BLL = new XmxxBLL(WorkUser);
            if (!this.IsPostBack)
            {
                this.db_PKID.Text = pkid;
                DataTable dt = BLL.GetXmxx(pkid);
                if (dt.Rows.Count > 0)
                {
                    List <IDataItem> list = dt.Rows[0].ToDataItem();
                    this.SetControlValue(list);
                }
            }
        }
예제 #5
0
        public string GetSsdq(HttpContext context)
        {
            XmxxBLL       BLL = new XmxxBLL(WorkUser);
            DataTable     dt  = BLL.GettbXzqdmDic();
            StringBuilder str = new StringBuilder();

            str.AppendFormat("<option  value='{0}' selected=\"selected\">{1}</option>", "", "请选择所属区域");
            foreach (DataRow row in dt.Rows)
            {
                str.AppendFormat("<option value='{0}'>{1}</option>", row["Code"], row["CodeInfo"]);
            }

            str.AppendFormat("<option value='{0}'>{1}</option>", "省内企业", "省内企业");
            str.AppendFormat("<option value='{0}'>{1}</option>", "省外企业", "省外企业");


            return(str.ToString());
        }
예제 #6
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string message = "", type = "";
            string operate        = context.Request.QueryString["operate"];
            object sessionAppUser = context.Session[ConfigManager.GetSignInAppUserSessionName()];

            BLL = new XmxxBLL((AppUser)sessionAppUser);
            FunctionResult <string> result = new FunctionResult <string>()
            {
                Status = FunctionResultStatus.Error
            };

            string pkid = context.Request.QueryString["pkid"];

            switch (operate.ToLower())
            {
            case "ajxx":
                result = BLL.Delete_aj_gcjbxx(pkid);
                break;

            case "zjxx":
                result = BLL.Delete_zj_gcjbxx(pkid);
                break;

            case "ajxx_ryxx":
                result = BLL.Delete_TBProjectBuilderUserInfo(pkid);
                break;
            }
            if (result.Status != FunctionResultStatus.Error)
            {
                type = "Success";
            }
            else
            {
                type    = "Error";
                message = result.Message.Message;
            }
            string json = @"{""Type"":""" + type + @""",""Message"":""" + message + @"""}";

            context.Response.Write(json);
            context.Response.End();
        }
예제 #7
0
        public string SetLxxmGIS(HttpContext context)
        {
            XmxxBLL BLL  = new XmxxBLL(WorkUser);
            string  PKID = context.Request.Form["PKID"];
            string  x    = context.Request.Form["x"];
            string  y    = context.Request.Form["y"];

            StringBuilder str = new StringBuilder();

            if (string.IsNullOrEmpty(x) || string.IsNullOrEmpty(y))
            {
                str.Append("{\"isSuccess\":false,\"Msg\":\"经纬度坐标不合法!\"}");
                return(str.ToString());
            }

            DataTable dt = BLL.GetXmxx(PKID);

            if (dt.Rows.Count > 0)
            {
                dt.Rows[0]["jd"]     = x;
                dt.Rows[0]["wd"]     = y;
                dt.Rows[0]["isSgbz"] = 1;

                if (BLL.SaveXmxx(dt))
                {
                    str.Append("{\"isSuccess\":true,\"Msg\":\"标注成功!\"}");
                }
                else
                {
                    str.Append("{\"isSuccess\":false,\"Msg\":\"标注失败!\"}");
                }
            }
            else
            {
                str.Append("{\"isSuccess\":false,\"Msg\":\"没有记录!\"}");
            }

            return(str.ToString());
        }
예제 #8
0
        public string GetXmxx(HttpContext context)
        {
            XmxxBLL BLL = new XmxxBLL(WorkUser);

            string        ssdq   = context.Request.Params["ssdq"];
            string        xmdjrq = context.Request.Params["xmdjrq"];
            string        xmmc   = context.Request.Params["xmmc"];
            StringBuilder str    = new StringBuilder();

            try
            {
                str.Append("[");
                DataTable dt = BLL.GetXmxx(ssdq, xmdjrq, xmmc);

                foreach (DataRow row in dt.Rows)
                {
                    str.Append("{");
                    str.AppendFormat("\"title\":\"{0}\",\"point\":\"{1}|{2}\",\"xmmc\":\"{3}\",\"jsdw\":\"{4}\",\"sgdw\":\"{5}\",\"jldw\":\"{6}\",\"kcdw\":\"{7}\",\"sjdw\":\"{8}\",\"kgrq\":\"{9}\",\"jsgm\":\"{10}\",\"xmztz\":\"{11}万元\",\"prjNum\":\"{12}\",\"isSgbz\":{13},\"PKID\":\"{14}\"",
                                     "工程项目概要信息", row["jd"], row["wd"], row["PrjName"].ToString().Replace("\"", ""), row["BuildCorpName"]
                                     , row["SgzcbCorpNames"] == DBNull.Value ? "" : row["SgzcbCorpNames"].ToString2().Trim(';')
                                     , row["JLCorpNames"] == DBNull.Value ? "" : row["JLCorpNames"].ToString2().Trim(';')
                                     , row["EconCorpNames"] == DBNull.Value ? "" : row["EconCorpNames"].ToString2().Trim(';')
                                     , row["DesignCorpNames"] == DBNull.Value ? "" : row["DesignCorpNames"].ToString2().Trim(';')
                                     , row["BDate"] == DBNull.Value ? "" : row["BDate"].ToDateTime().ToString("yyyy-MM-dd")
                                     , row["PrjSize"], row["AllInvest"] == DBNull.Value ? "0" : row["AllInvest"].ToString2()
                                     , row["PrjNum"], row["isSgbz"].ToInt32(0), row["PKID"]);
                    str.Append("},");
                }

                return(str.ToString().TrimEnd(',') + "]");
            }
            catch (Exception ex)
            {
                str.Append(ex.Message);
            }
            return(str.ToString());
        }