Пример #1
0
        public void Page_Apply()
        {
            M_PageReg regMod = regBll.SelModelByUid(mu.UserID);

            if (regMod == null)
            {
                regMod         = new M_PageReg();
                regMod.ModelID = DataConvert.CLng(Request.Form["ApplyModel_Rad"]);
            }
            DataTable dt         = fieldBll.GetModelFieldList(regMod.ModelID);
            Call      commonCall = new Call();
            DataTable table      = commonCall.GetDTFromMVC(dt, Request);

            regMod.CompanyName = Request.Form["CompanyName"];
            regMod.PageTitle   = mu.UserName + "的黄页信息";
            regMod.PageInfo    = Request.Form["PageInfo"];
            regMod.LOGO        = Request.Form["LOGO_t"];
            regMod.NodeStyle   = DataConverter.CLng(Request.Form["TempleID_Hid"]);//样式与首页模板??,首页模板可动态以styleMod中为准
            regMod.Template    = Request.Form["TempleUrl_Hid"];
            regMod.Status      = SiteConfig.SiteOption.RegPageStart ? 0 : 99;
            if (regMod.ID > 0)
            {
                conBll.Page_Update(table, regMod);
                function.WriteSuccessMsg("修改提交成功", "PageInfo"); return;
            }
            else
            {
                M_ModelInfo applyMod = modBll.SelReturnModel(regMod.ModelID);
                regMod.TableName = applyMod.TableName;
                regMod.UserName  = mu.UserName;
                regMod.UserID    = mu.UserID;
                regMod.ID        = conBll.Page_Add(table, regMod);
                function.WriteSuccessMsg("申请提交成功", "PageInfo"); return;
            }
        }
Пример #2
0
        public void Page_Apply()
        {
            string tempurl = Request.Form["templateUrl"];
            int    InfoID  = DataConverter.CLng(Request.Form["ID_Hid"]);
            int    ModelID = DataConverter.CLng(Request.Form["ModelID_Hid"]);

            conBll.UpTemplata(InfoID, tempurl);
            DataTable   dt           = fieldBll.GetModelFieldList(ModelID);
            M_ModelInfo model        = modBll.GetModelById(ModelID);
            string      pagetemplate = "";

            if (model.ModelID > 0)
            {
                pagetemplate = model.ContentModule;
            }
            else
            {
                pagetemplate = "";
            }
            Call      commonCall = new Call();
            DataTable table;

            try
            {
                table = commonCall.GetDTFromMVC(dt, Request);
            }
            catch (Exception e)
            {
                function.WriteErrMsg(e.Message); return;
            }
            DataRow rs1 = table.NewRow();

            rs1[0] = "UserID";
            rs1[1] = "int";
            rs1[2] = mu.UserID;
            DataRow rs2 = table.NewRow();

            rs2[0] = "UserName";
            rs2[1] = "TextType";
            rs2[2] = mu.UserName;
            DataRow rs3 = table.NewRow();

            //Styleid|黄页样式ID|数字|0
            rs3[0] = "Styleid";
            rs3[1] = "int";
            int styleid = DataConverter.CLng(Request.Form["TempleID_Hid"]);

            rs3[2] = styleid == 0 ? 1 : styleid; //未选择,则默认第一个
            table.Rows.Add(rs1);
            table.Rows.Add(rs2);
            table.Rows.Add(rs3);

            int       styless   = DataConverter.CLng(Request.Form["StyleID"]);
            string    tablename = modBll.GetModelById(styless).TableName;
            M_PageReg crMod     = prBll.GetSelectByUserID(mu.UserID);

            if (crMod == null)
            {
                crMod = new M_PageReg();
            }
            crMod.CompanyName = Request.Form["CompanyName"];
            crMod.UserName    = mu.UserName;
            crMod.UserID      = mu.UserID;
            crMod.PageTitle   = mu.UserName + "的黄页信息";
            crMod.PageInfo    = Request.Form["PageInfo"];
            crMod.LOGO        = Request.Form["LOGO"];
            crMod.NodeStyle   = DataConverter.CLng(Request.Form["TempleID_Hid"]);
            crMod.Template    = Request.Form["TempleUrl_Hid"];
            if (SiteConfig.SiteOption.RegPageStart)
            {
                crMod.Status = 0;
            }
            else
            {
                crMod.Status = 99;
            }
            crMod.TableName    = tablename;
            crMod.ModelID      = styless;
            crMod.CreationTime = DateTime.Now;
            if (crMod.ID > 0)
            {
                conBll.Page_Update(table, crMod);
                function.WriteSuccessMsg("修改提交成功", "PageInfo"); return;
            }
            else
            {
                crMod.TopWords         = "";
                crMod.Style            = 0;
                crMod.ParentPageUserID = 0;
                crMod.ParentPageID     = 0;
                crMod.Keyword          = "";
                crMod.InfoID           = 0;
                crMod.Hits             = 0;
                crMod.NavHeight        = "0";
                crMod.NavColor         = "";
                crMod.Description      = "";
                crMod.BottonWords      = "";
                int newID = conBll.Page_Add(table, crMod);
                function.WriteSuccessMsg("申请提交成功", "PageInfo"); return;
            }
        }