Beispiel #1
0
        //end

        public ActionResult Add_DB_WebConfig()
        {
            this.Response.ContentType = "text/plain";
            NModel.DB_WebConfig model = new NModel.DB_WebConfig();
            BLL.DB_WebConfig    dal   = new BLL.DB_WebConfig();

            String JsonStr = "";

            bool isGet = Tool.NStr.PostForSetVal <NModel.DB_WebConfig>(ref model, ref JsonStr, "");

            // 下面代码编写
            if (isGet
                //&& !string.IsNullOrEmpty(model.WebConfig_Code) &&
                //    !string.IsNullOrEmpty(model.WebConfig_Description)
                // &&!string.IsNullOrEmpty(model.WebConfig_Title)
                //&&!string.IsNullOrEmpty(model.WebConfig_Keywords

                )
            {
                {
                    model.WebConfig_EditTime = DateTime.Parse(DateTime.Now.ToString("s"));
                    model.WebConfig_AddTime  = DateTime.Parse(DateTime.Now.ToString("s"));
                    //
                    bool isAdd = dal.AddFree(model) > 0 ? true : false;

                    if (isAdd)
                    {
                        this.Response.Write(Tool.NMsg.SetMsg("增加成功", "1"));
                        this.Response.End();
                    }
                    else
                    {
                        this.Response.Write(Tool.NMsg.SetMsg("增加失败" + dal.ErrorMsg, "1"));
                        this.Response.End();
                    }
                }
            }
            else
            {
                this.Response.Write(Tool.NMsg.SetMsg("提交失败", "0"));
            }

            dal.Close();

            return(View());
        }