예제 #1
0
        /// <summary>
        /// 初始化主页设置模块
        /// </summary>
        /// <param name="context"></param>
        private void InitIndexModel(HttpContext context)
        {
            try
            {
                string loginName = Common.GetSessionValue("loginName", context);
                if (loginName == null)
                {
                    context.Response.Write("as");
                    return;
                }

                string EnterpriseCode = Common.GetSessionValue("EnterpriseCode", context);
                if (EnterpriseCode == null)
                {
                    context.Response.Write("as");
                    return;
                }

                DataSet SourceTemp = new DataSet();
                SourceTemp = GetIndexTemp(loginName, EnterpriseCode);
                if (SourceTemp != null && SourceTemp.Tables.Count > 0)
                {
                    DataTable dt1 = SourceTemp.Tables[0];
                    if (dt1 != null && dt1.Rows.Count > 0)
                    {
                        ModelEntyty        entity = new ModelEntyty();
                        List <ModelEntyty> list   = new List <ModelEntyty>();
                        foreach (DataRow Dtr in dt1.Rows)
                        {
                            entity                = new ModelEntyty();
                            entity.Model_ID       = Convert.ToInt32(Dtr["Fun_ID"]);
                            entity.Model_Name     = Dtr["Fun_Name"].ToString();
                            entity.Model_Type     = Convert.ToInt32(Dtr["Fun_Type"]);
                            entity.Model_ParentID = Convert.ToInt32(Dtr["Fun_ParentID"] == DBNull.Value ? "0" : Dtr["Fun_ParentID"].ToString());
                            entity.IfSet          = Convert.ToInt32(Dtr["CK"]);
                            entity._Fun_Class     = Convert.ToString(Dtr["Fun_Class"]);
                            list.Add(entity);
                        }
                        DataTable dt2 = SourceTemp.Tables[1];
                        string    ids = "";
                        if (dt2 != null && dt2.Rows.Count > 0)
                        {
                            ids = dt2.Rows[0][0].ToString();
                        }
                        context.Response.Write(new JavaScriptSerializer().Serialize(new object[] { list, ids }));
                        return;
                    }
                }
            }
            catch
            {
                context.Response.Write("as");
            }
        }
예제 #2
0
        private void LoadModular(HttpContext context)
        {
            DataTable SourceTemp = new DataTable();

            try
            {
                string loginName = Common.GetSessionValue("loginName", context);
                if (loginName == null)
                {
                    context.Response.Write("as");
                    return;
                }
                string EnterpriseCode = Common.GetSessionValue("EnterpriseCode", context);
                if (EnterpriseCode == null)
                {
                    context.Response.Write("as");
                    return;
                }
                SourceTemp = MgrServices.IndexService.GetModularStrByLoginName(loginName, EnterpriseCode);
                if (SourceTemp != null && SourceTemp.Rows.Count > 0)
                {
                    ModelEntyty        entity = new ModelEntyty();
                    List <ModelEntyty> list   = new List <ModelEntyty>();
                    foreach (DataRow Dtr in SourceTemp.Rows)
                    {
                        entity            = new ModelEntyty();
                        entity.Model_ID   = Convert.ToInt32(Dtr["Fun_ID"]);
                        entity.Model_Name = Dtr["Fun_Name"] == DBNull.Value ? "" : Dtr["Fun_Name"].ToString();
                        entity.Model_Type = Convert.ToInt32(Dtr["Fun_Type"]);
                        entity.HtmlUrl    = Dtr["Fun_Url"] == DBNull.Value ? "" : Dtr["Fun_Url"].ToString();
                        entity._Fun_Class = Convert.ToString(Dtr["Fun_Class"]);
                        list.Add(entity);
                    }
                    context.Response.Write(new JavaScriptSerializer().Serialize(list));
                    return;
                }
                else
                {
                    context.Response.Write("");
                    return;
                }
            }
            catch
            {
                context.Response.Write("as");
                return;
            }
        }