예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(33);

        if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"]))
        {
            try
            {
                CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);
            }
            catch { }
        }

        if (!Page.IsPostBack)
        {
            MCustomForm = BCustomForm.GetModel(CustomFormId);

            if (CustomFormId != 0)
            {

                if (MCustomForm == null)
                {
                    Function.ShowSysMsg(0, "<li>表单不存在或已经被删除</li><li><a href='infomodel/CustomFormList.aspx'>返回表单管理列表</a></li>");
                }
            }

            FormName.Text = MCustomForm.FormName;

            DataList();
        }
    }
예제 #2
0
    protected void RepCustomFormField_ItemCommand(object sender, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "Delete")
        {
            int FieldId = int.Parse(e.CommandArgument.ToString());
            MCustomFormField = BCustomFormField.GetModel(FieldId);

            MCustomForm = BCustomForm.GetModel(CustomFormId);

            BCustomFormField.Del(FieldId);
            BModelField.DelField(MCustomForm.TableName, MCustomFormField.Name);

            DataList();
        }

        if (e.CommandName == "UpMove")
        {
            int FieldId = int.Parse(e.CommandArgument.ToString());

            BCustomFormField.MoveField(CustomFormId, FieldId, "UpMove");

            DataList();
        }

        if (e.CommandName == "DownMove")
        {
            int FieldId = int.Parse(e.CommandArgument.ToString());

            BCustomFormField.MoveField(CustomFormId, FieldId, "DownMove");

            DataList();
        }
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(33);
        muser = buser.GetCookie();

        if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"]))
        {
            try
            {
                CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);
            }
            catch { }
        }

        MCustomForm = BCustomForm.GetModel(CustomFormId);

        if (MCustomForm == null)
        {
            Function.ShowMsg(0, "<li>表单不存在或已经被删除</li><li><a href='welcome.aspx'>返回表单管理列表</a></li>");
        }

        if (!Page.IsPostBack)
        {
            CustomFormName.Text = MCustomForm.FormName;
            GetAll();
        }
    }
예제 #4
0
 public void Add(M_CustomForm model)
 {
     this.dal.Add(model);
     this.dal.AddTable(model.TableName);
     if (!Directory.Exists(Param.SiteRootPath + "/upload/" + model.UploadPath))
     {
         Directory.CreateDirectory(Param.SiteRootPath + "/upload/" + model.UploadPath);
     }
 }
예제 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"]))
        {
            try
            {
                CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);
            }
            catch { }
        }

        dtIsUser = BCustomFormField.GetIsUserList(CustomFormId);
        MCustomForm = BCustomForm.GetModel(CustomFormId);

        if (!Page.IsPostBack)
        {
            //权限验证
            GetIsOk();

            if (dtIsUser.Rows.Count > 0)
            {
                Response.Write("document.write(\"<script type='text/javascript' src='" + Param.ApplicationRootPath + "/js/Common.js'></script><script src='" + Param.ApplicationRootPath + "/js/RiQi.js'type='text/javascript'></script>\");");
                Response.Write("document.write(\"<form name='form1' method='post' action='" + Param.ApplicationRootPath + "/other/AddInfoForm.aspx?CustomFormId=" + CustomFormId + "' id='form1'>\");");
                Response.Write("document.write(\"<input name='FilePicPath' type='text' value='" + MCustomForm.UploadPath + "|" + MCustomForm.UploadSize + "' id='FilePicPath' style='display: none'>\");");
                Response.Write("document.write(\"<table border='0' cellpadding='0' cellspacing='1' class='border' style='width: 99%' align='center'>\");");

                for (int i = 0; i < dtIsUser.Rows.Count; i++)
                {
                    Response.Write("document.write(\"<tr class='tdbg'>\");");
                    Response.Write("document.write(\"<td align='right' class='bqleft'>\");");
                    Response.Write("document.write(\"" + dtIsUser.Rows[i]["Alias"].ToString() + ":\");");
                    Response.Write("document.write(\"</td>\");");
                    Response.Write("document.write(\"<td class='bqright'>\");");
                    Response.Write("document.write(\"" + GetShowStyle(dtIsUser.Rows[i]["Name"].ToString(), dtIsUser.Rows[i]["IsNotNull"].ToString(), dtIsUser.Rows[i]["Type"].ToString(), dtIsUser.Rows[i]["Content"].ToString(), dtIsUser.Rows[i]["Description"].ToString()).Replace("\"","") + "\");");
                    Response.Write("document.write(\"</td>\");");
                    Response.Write("document.write(\"</tr>\");");
                }
                if (MCustomForm.IsValidate)
                {
                    Response.Write("document.write(\"<tr class='tdbg'><td align='right' class='bqleft'>验证码:</td><td class='bqright'>\");");
                    Response.Write("document.write(\"<input type='text' size='10' name='txtValidate'> <img src='" + Param.ApplicationRootPath + "/Common/Code.aspx' id='IMG1' onclick=this.src='" + Param.ApplicationRootPath + "/Common/Code.aspx' alt='给我换一个'>\");");
                    Response.Write("document.write(\"</td></tr>\");");
                }
                Response.Write("document.write(\"<tr class='tdbg'><td height='40' align='right' class='bqleft'></td><td class='bqright'>\");");
                Response.Write("document.write(\"<input type='submit' value=' 提 交 ' class='btn'>\");");
                Response.Write("document.write(\"</td></tr>\");");

                Response.Write("document.write(\"</table>\");");
                Response.Write("document.write(\"</form>\");");
            }

            dtIsUser.Clear();
            dtIsUser.Dispose();
        }
    }
예제 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(33);
        Response.Cache.SetNoStore();
        if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"]))
        {
            try
            {
                CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);
            }
            catch { }
        }

        dtIsUser = BCustomFormField.GetIsUserList(CustomFormId);
        MCustomForm = BCustomForm.GetModel(CustomFormId);

        //判断是否有字段
        if (dtIsUser.Rows.Count < 1)
        {
            Response.Write("<script>alert('该表单下还没有添加字段,不能够调用');window.close();</script>");
            Response.End();
        }

        //判断是否起用了时间限制
        if (MCustomForm.IsUnlockTime)
        {
            if (DateTime.Parse(MCustomForm.StartTime.ToShortDateString()) > DateTime.Parse(DateTime.Now.ToShortDateString()))
            {
                Response.Write("<script>alert('" + MCustomForm.FormName + "启用了时间限制,还不能使用" + MCustomForm.FormName + "');window.close();</script>");
                Response.End();
            }

            if (DateTime.Parse(MCustomForm.EndTime.ToShortDateString()) < DateTime.Parse(DateTime.Now.ToShortDateString()))
            {
                Response.Write("<script>alert('" + MCustomForm.FormName + "启用了时间限制,目前已经过期');window.close();</script>");
                Response.End();
            }
        }

        dtIsUser.Clear();
        dtIsUser.Dispose();

        if (!Page.IsPostBack)
        {
            FormName.Text = MCustomForm.FormName;
            TextBox1.Text = "<script language=\"javascript\" src=\"" + Param.ApplicationRootPath + "/other/CustomForm.aspx?CustomFormId=" + CustomFormId + "\" type=\"text/javascript\"></script>";
        }
    }
예제 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(33);

        if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"]))
        {
            try
            {
                CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);
            }
            catch { }
        }

        if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
        {
            try
            {
                Id = int.Parse(Request.QueryString["Id"]);
            }
            catch { }
        }

        MCustomForm = BCustomForm.GetModel(CustomFormId);

        dtInfo = BCustomFormField.GetList(CustomFormId);

        dr = BInfoOper.GetInfo(MCustomForm.TableName, Id);

        if (!Page.IsPostBack)
        {
            CustomFormName.Text = MCustomForm.FormName;

            //绑定自定义字段
            Repeater1.DataSource = dtInfo;
            Repeater1.DataBind();

            dtInfo.Clear();
            dtInfo.Dispose();

            MCustomForm=BCustomForm.GetModel(CustomFormId);

            FilePicPath.Text = MCustomForm.UploadPath;
        }
    }
예제 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(33);
        CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);

        if (!Page.IsPostBack)
        {
            //绑定自定义字段
            DataTable dt1 = new DataTable();
            dt1 = BCustomFormField.GetList(CustomFormId);
            Repeater1.DataSource = dt1;
            Repeater1.DataBind();

            dt1.Clear();
            dt1.Dispose();

            MCustomForm=BCustomForm.GetModel(CustomFormId);

            FilePicPath.Text = MCustomForm.UploadPath + "|" + MCustomForm.UploadSize.ToString();
        }
    }
예제 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);
        dtIsUser = BCustomFormField.GetIsUserList(CustomFormId);
        MCustomForm = BCustomForm.GetModel(CustomFormId);

        if (!Page.IsPostBack)
        {
            //验证
            GetIsOk();

            if (MCustomForm.IsValidate)
            {
                string validateCode = string.Empty;
                if (Session["ValidateCode"] == null)
                {
                    Function.ShowMsg(0, "<li>你在页面停留的时间过长,验证码已经失效</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
                }

                validateCode = Session["ValidateCode"].ToString();
                //验证码错误
                if (validateCode != Request.Form["txtValidate"].Trim().ToLower())
                {
                    Function.ShowMsg(0, "<li>验证码错误</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
                }
            }

            int sUId = 0;
            string sUName = "匿名用户";

            if (BUser.IsLogin())
            {
                sUId = BUser.GetCookie().UserID;
                sUName = BUser.GetUser(BUser.GetCookie().UserID).LogName;
            }

            //只允许提交一次
            if (MCustomForm.IsSubmitNum)
            {
                //判断是否多次提交
                if (!Function.ReadTempCookies("CustomForm_" + CustomFormId, CustomFormId.ToString()))
                {
                    Function.SaveTempCookies("CustomForm_" + CustomFormId, CustomFormId.ToString());
                }
                else
                {
                    Function.ShowMsg(0, "<li>" + MCustomForm.FormName + "设置用户只能够提交一次数据</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
                }
            }

            //金币
            if (sUId != 0)
            {
                B_User buser = new B_User();
                M_User muser = buser.GetUser(sUId);

                if (muser.YellowBoy + MCustomForm.Money < 0)
                {
                    Function.ShowMsg(0, "<li>你剩余的金币不足,无法提交该表单</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
                }
                else
                {
                    BMoney.YellowBoy(MCustomForm.Money, sUId);
                }
            }

            string TableName = MCustomForm.TableName;

            //定义DataTable
            DataTable dt = new DataTable();
            dt.Columns.Add(new DataColumn("FieldName", typeof(string)));
            dt.Columns.Add(new DataColumn("FieldValue", typeof(string)));

            #region 系统默认字段
            DataRow dr1 = dt.NewRow();
            dr1[0] = "UId";
            dr1[1] = sUId;
            dt.Rows.Add(dr1);

            DataRow dr2 = dt.NewRow();
            dr2[0] = "UName";
            dr2[1] = sUName;
            dt.Rows.Add(dr2);

            DataRow dr3 = dt.NewRow();
            dr3[0] = "Ip";
            dr3[1] = Request.ServerVariables["REMOTE_ADDR"];
            dt.Rows.Add(dr3);

            DataRow dr4 = dt.NewRow();
            dr4[0] = "AddTime";
            dr4[1] = DateTime.Now.ToString();
            dt.Rows.Add(dr4);

            #endregion

            //以下是自动添加字段获得值
            for (int i = 0; i < dtIsUser.Rows.Count; i++)
            {
                DataRow dr = dt.NewRow();
                dr[0] = dtIsUser.Rows[i]["Name"].ToString();

                switch (dtIsUser.Rows[i]["Type"].ToString())
                {
                    case "ListBoxType":
                        if (Request.Form["txt_" + dtIsUser.Rows[i]["Name"].ToString() + ""] == "" || Request.Form["txt_" + dtIsUser.Rows[i]["Name"].ToString() + ""] == null)
                        {
                            dr[1] = Request.Form["txt_" + dtIsUser.Rows[i]["Name"].ToString() + ""];
                        }
                        else
                        {
                            dr[1] = Request.Form["txt_" + dtIsUser.Rows[i]["Name"].ToString() + ""].Replace(" ", "").ToString();
                        }
                        break;
                    case "MultipleTextType":
                        dr[1] = Request.Form["txt_" + dtIsUser.Rows[i]["Name"].ToString() + ""];
                        break;
                    default:
                        dr[1] = Request.Form["txt_" + dtIsUser.Rows[i]["Name"].ToString() + ""];
                        break;
                }
                dt.Rows.Add(dr);
            }

            //添加信息
            BInfoModel.AddInfoModel(dt, TableName);

            Function.ShowMsg(1, "<li>成功提交信息</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");

            dtIsUser.Clear();
            dtIsUser.Dispose();
        }
    }
예제 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(33);
        Response.Cache.SetNoStore();

        if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"]))
        {
            try
            {
                CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);
            }
            catch { }
        }

        dtIsUser = BCustomFormField.GetIsUserList(CustomFormId);
        MCustomForm = BCustomForm.GetModel(CustomFormId);

        //判断是否有字段
        if (dtIsUser.Rows.Count<1)
        {
            Response.Write("<script>alert('该表单下还没有添加字段,不能够调用');window.close();</script>");
            Response.End();
        }

        //判断是否起用了时间限制
        if (MCustomForm.IsUnlockTime)
        {
            if (DateTime.Parse(MCustomForm.StartTime.ToShortDateString()) > DateTime.Parse(DateTime.Now.ToShortDateString()))
            {
                Response.Write("<script>alert('" + MCustomForm.FormName + "启用了时间限制,还不能使用" + MCustomForm.FormName + "');window.close();</script>");
                Response.End();
            }

            if (DateTime.Parse(MCustomForm.EndTime.ToShortDateString()) < DateTime.Parse(DateTime.Now.ToShortDateString()))
            {
                Response.Write("<script>alert('" + MCustomForm.FormName + "启用了时间限制,目前已经过期');window.close();</script>");
                Response.End();
            }
        }

        if (!Page.IsPostBack)
        {
            FormName.Text = MCustomForm.FormName;
            string MyText="";

            MyText += "<script type=\"text/javascript\" src=\"" + Param.ApplicationRootPath + "/js/Common.js\"></script>\r\n<script src=\"" + Param.ApplicationRootPath + "/js/RiQi.js\" type=\"text/javascript\"></script>\r\n";
            MyText += "<form name=\"form1\" method=\"post\" action=\"" + Param.ApplicationRootPath + "/other/AddInfoForm.aspx?CustomFormId=" + CustomFormId + "\" id=\"form1\">\r\n<input name=\"FilePicPath\" type=\"text\" value=\"" + MCustomForm.UploadPath + "|" + MCustomForm.UploadSize + "\" id=\"FilePicPath\" style=\"display: none\">\r\n";
            MyText += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" class=\"border\" style=\"width: 99%\" align=\"center\">\r\n";

            for (int i = 0; i < dtIsUser.Rows.Count; i++)
            {
                MyText += "<tr class=\"tdbg\">\r\n";
                MyText += "<td align=\"right\" class=\"bqleft\">" + dtIsUser.Rows[i]["Alias"].ToString() + ":</td>\r\n";
                MyText += "<td class=\"bqright\">" + GetShowStyle(dtIsUser.Rows[i]["Name"].ToString(), dtIsUser.Rows[i]["IsNotNull"].ToString(), dtIsUser.Rows[i]["Type"].ToString(), dtIsUser.Rows[i]["Content"].ToString(), dtIsUser.Rows[i]["Description"].ToString()) + "</td>\r\n";
                MyText += "</tr>\r\n";
            }

            if (MCustomForm.IsValidate)
            {
                MyText += "<tr class=\"tdbg\">\r\n<td align=\"right\" class=\"bqleft\">验证码:</td>\r\n<td class=\"bqright\"><input type=\"text\" size=\"10\" name=\"txtValidate\"> <img src=\"" + Param.ApplicationRootPath + "/Common/Code.aspx\" id=\"IMG1\" onclick=this.src=\"" + Param.ApplicationRootPath + "/Common/Code.aspx\" alt=\"给我换一个\">\r\n</td>\r\n</tr>\r\n";
            }
            MyText += "<tr class=\"tdbg\">\r\n<td height=\"40\" align=\"right\" class=\"bqleft\"></td>\r\n<td class=\"bqright\"><input type=\"submit\" value=\" 提 交 \" class=\"btn\">\r\n</td>\r\n</tr>\r\n";
            MyText += "</table>\r\n";
            MyText+="</form>";

            TextBox1.Text = MyText;
        }
    }
예제 #11
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        //验证
        GetIsOk();

        MCustomForm = BCustomForm.GetModel(CustomFormId);
        string TableName = MCustomForm.TableName;

        //定义DataTable
        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("FieldName", typeof(string)));
        dt.Columns.Add(new DataColumn("FieldValue", typeof(string)));

        #region 系统默认字段
        DataRow dr0 = dt.NewRow();
        dr0[0] = "Id";
        dr0[1] = Id;
        dt.Rows.Add(dr0);

        DataRow dr1 = dt.NewRow();
        dr1[0] = "UId";
        dr1[1] = "0";
        dt.Rows.Add(dr1);

        DataRow dr2 = dt.NewRow();
        dr2[0] = "UName";
        dr2[1] = "匿名用户";
        dt.Rows.Add(dr2);

        DataRow dr3 = dt.NewRow();
        dr3[0] = "Ip";
        dr3[1] = Request.ServerVariables["REMOTE_ADDR"];
        dt.Rows.Add(dr3);

        DataRow dr4 = dt.NewRow();
        dr4[0] = "AddTime";
        dr4[1] = DateTime.Now.ToString();
        dt.Rows.Add(dr4);

        #endregion

        //以下是自动添加字段获得值
        for (int i = 0; i < dtInfo.Rows.Count; i++)
        {
            DataRow dr = dt.NewRow();
            dr[0] = dtInfo.Rows[i]["Name"].ToString();

            switch (dtInfo.Rows[i]["Type"].ToString())
            {
                case "ListBoxType":
                    if (Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""] == "" || Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""] == null)
                    {
                        dr[1] = Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""];
                    }
                    else
                    {
                        dr[1] = Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""].Replace(" ", "").ToString();
                    }
                    break;
                case "MultipleTextType":
                    dr[1] = Function.Encode(Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""]);
                    break;
                default:
                    dr[1] = Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""];
                    break;
            }
            dt.Rows.Add(dr);
        }

        //添加信息
        BInfoModel.UpdateInfoModel(dt, TableName);
        dtInfo.Clear();
        dtInfo.Dispose();
        Function.ShowSysMsg(1, "<li>成功修改!</li><li><a href='infomodel/UpdateInfoCustomForm.aspx?CustomFormId=" + CustomFormId + "&Id=" + Id + "'>重新修改</a> <a href='infomodel/CustomFormInfoList.aspx?CustomFormId=" + CustomFormId + "'>返回" + MCustomForm.FormName + "列表</a></li>");
    }
예제 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(33);

        if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"]))
        {
            try
            {
                CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);
            }
            catch { }
        }

        if (!string.IsNullOrEmpty(Request.QueryString["FieldId"]))
        {
            try
            {
                FieldId = int.Parse(Request.QueryString["FieldId"]);
            }
            catch { }
        }

        MCustomForm = BCustomForm.GetModel(CustomFormId);

        if (!Page.IsPostBack)
        {

            if (CustomFormId != 0)
            {
                if (MCustomForm == null)
                {
                    Function.ShowSysMsg(0, "<li>表单不存在或已经被删除</li><li><a href='infomodel/CustomFormList.aspx'>返回表单管理列表</a> <a href='infomodel/CustomFormFieldList.aspx?CustomFormId=" + CustomFormId + "'>返回字段管理列表</a></li>");
                }
            }

            if (FieldId != 0)
            {
                MCustomFormField = BCustomFormField.GetModel(FieldId);

                if (MCustomFormField == null)
                {
                    Function.ShowSysMsg(0, "<li>该字段不存在或已经被删除</li><li><a href='infomodel/CustomFormList.aspx'>返回表单管理列表</a> <a href='infomodel/CustomFormFieldList.aspx?CustomFormId=" + CustomFormId + "'>返回字段管理列表</a></li>");
                }

                GetShow();
                Name.Enabled = false;
                Type.Enabled = false;
                Button1.Text = " 确认修改 ";
            }

            FormName.Text = MCustomForm.FormName;
        }
    }
예제 #13
0
    private void GetModel()
    {
        MCustomForm = BCustomForm.GetModel(CustomFormId);

        txtShowForm.SelectedValue = MCustomForm.ShowForm.ToString();
        txtFormName.Text=MCustomForm.FormName;
        txtTableName.Text = MCustomForm.TableName.Replace("Ky_Form_", "");
        txtUploadPath.Text=MCustomForm.UploadPath;
        txtFormDesc.Text=MCustomForm.FormDesc;
        txtIsUnlockTime.SelectedValue=MCustomForm.IsUnlockTime.ToString();
        txtStartTime.Text=MCustomForm.StartTime.ToShortDateString();
        txtEndTime.Text = MCustomForm.EndTime.ToShortDateString();
        txtUploadSize.Text = MCustomForm.UploadSize.ToString();

        if (UserGroupList.Items.Count > 0)
        {
            for (int i = 0; i < UserGroupList.Items.Count; i++)
            {
                if(MCustomForm.UserGroup.IndexOf("|"+UserGroupList.Items[i].Value+"|")!=-1)
                {
                    UserGroupList.Items[i].Selected = true;
                }
            }
        }
        txtIsSubmitNum.SelectedValue=MCustomForm.IsSubmitNum.ToString();
        txtMoney.Text=MCustomForm.Money.ToString();
        txtIsValidate.SelectedValue=MCustomForm.IsValidate.ToString();
    }
예제 #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"]))
        {
            try
            {
                CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);
            }
            catch { }
        }

        MCustomForm = BCustomForm.GetModel(CustomFormId);
        dtInfo = BCustomFormField.GetIsUserList(CustomFormId);

        if (!Page.IsPostBack)
        {
            //权限验证
            GetPowerValidate();

            CustomFormName.Text = MCustomForm.FormName;

            //绑定自定义字段
            Repeater1.DataSource = dtInfo;
            Repeater1.DataBind();

            dtInfo.Clear();
            dtInfo.Dispose();

            FilePicPath.Text = MCustomForm.UploadPath + "|" + MCustomForm.UploadSize.ToString();

            if (MCustomForm.IsValidate)
            {
                FormTr1.Visible = true;
            }
        }
    }
예제 #15
0
 public void Update(M_CustomForm model)
 {
     this.dal.Update(model);
 }
예제 #16
0
 public M_CustomForm GetModel(int CustomFormId)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@CustomFormId", SqlDbType.Int, 4) };
     commandParameters[0].Value = CustomFormId;
     M_CustomForm form = new M_CustomForm();
     DataSet set = SqlHelper.ExecuteDataSet(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_CustomForm_GetModel", commandParameters);
     if (set.Tables[0].Rows.Count > 0)
     {
         if (set.Tables[0].Rows[0]["ShowForm"].ToString() != "")
         {
             form.ShowForm = int.Parse(set.Tables[0].Rows[0]["ShowForm"].ToString());
         }
         if (set.Tables[0].Rows[0]["UploadSize"].ToString() != "")
         {
             form.UploadSize = int.Parse(set.Tables[0].Rows[0]["UploadSize"].ToString());
         }
         form.FormName = set.Tables[0].Rows[0]["FormName"].ToString();
         form.TableName = set.Tables[0].Rows[0]["TableName"].ToString();
         form.UploadPath = set.Tables[0].Rows[0]["UploadPath"].ToString();
         form.FormDesc = set.Tables[0].Rows[0]["FormDesc"].ToString();
         if (set.Tables[0].Rows[0]["IsUnlockTime"].ToString() != "")
         {
             if ((set.Tables[0].Rows[0]["IsUnlockTime"].ToString() == "1") || (set.Tables[0].Rows[0]["IsUnlockTime"].ToString().ToLower() == "true"))
             {
                 form.IsUnlockTime = true;
             }
             else
             {
                 form.IsUnlockTime = false;
             }
         }
         if (set.Tables[0].Rows[0]["StartTime"].ToString() != "")
         {
             form.StartTime = DateTime.Parse(set.Tables[0].Rows[0]["StartTime"].ToString());
         }
         if (set.Tables[0].Rows[0]["EndTime"].ToString() != "")
         {
             form.EndTime = DateTime.Parse(set.Tables[0].Rows[0]["EndTime"].ToString());
         }
         form.UserGroup = set.Tables[0].Rows[0]["UserGroup"].ToString();
         if (set.Tables[0].Rows[0]["IsSubmitNum"].ToString() != "")
         {
             if ((set.Tables[0].Rows[0]["IsSubmitNum"].ToString() == "1") || (set.Tables[0].Rows[0]["IsSubmitNum"].ToString().ToLower() == "true"))
             {
                 form.IsSubmitNum = true;
             }
             else
             {
                 form.IsSubmitNum = false;
             }
         }
         if (set.Tables[0].Rows[0]["Money"].ToString() != "")
         {
             form.Money = int.Parse(set.Tables[0].Rows[0]["Money"].ToString());
         }
         if (set.Tables[0].Rows[0]["IsValidate"].ToString() != "")
         {
             if ((set.Tables[0].Rows[0]["IsValidate"].ToString() == "1") || (set.Tables[0].Rows[0]["IsValidate"].ToString().ToLower() == "true"))
             {
                 form.IsValidate = true;
             }
             else
             {
                 form.IsValidate = false;
             }
         }
         if (set.Tables[0].Rows[0]["AddTime"].ToString() != "")
         {
             form.AddTime = DateTime.Parse(set.Tables[0].Rows[0]["AddTime"].ToString());
         }
         return form;
     }
     return null;
 }
예제 #17
0
 public void Add(M_CustomForm model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@ShowForm", model.ShowForm), new SqlParameter("@FormName", model.FormName), new SqlParameter("@TableName", model.TableName), new SqlParameter("@UploadPath", model.UploadPath), new SqlParameter("@FormDesc", model.FormDesc), new SqlParameter("@IsUnlockTime", model.IsUnlockTime), new SqlParameter("@StartTime", model.StartTime), new SqlParameter("@EndTime", model.EndTime), new SqlParameter("@UserGroup", model.UserGroup), new SqlParameter("@IsSubmitNum", model.IsSubmitNum), new SqlParameter("@Money", model.Money), new SqlParameter("@IsValidate", model.IsValidate), new SqlParameter("@AddTime", model.AddTime) };
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_CustomForm_Add", commandParameters);
 }
예제 #18
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        //验证
        GetIsOk();

        MCustomForm = BCustomForm.GetModel(CustomFormId);
        string TableName = MCustomForm.TableName;

        int sUId = 0;
        string sUName = "匿名用户";

        if (BUser.IsLogin())
        {
            sUId = BUser.GetCookie().UserID;
            sUName = BUser.GetUser(BUser.GetCookie().UserID).LogName;
        }

        if (MCustomForm.UserGroup != "|")
        {
            //只允许提交一次
            if (MCustomForm.IsSubmitNum)
            {
                DataTable dt1 = new DataTable();
                dt1 = BCustomForm.GetFormSubmitNum(MCustomForm.TableName, sUId);
                if (dt1.Rows.Count > 0)
                {
                    Function.ShowMsg(0, "<li>" + MCustomForm.FormName + "设置用户只能够提交一次数据</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
                }
                dt1.Clear();
                dt1.Dispose();
            }
        }

        //定义DataTable
        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("FieldName", typeof(string)));
        dt.Columns.Add(new DataColumn("FieldValue", typeof(string)));

        #region 系统默认字段
        DataRow dr1 = dt.NewRow();
        dr1[0] = "UId";
        dr1[1] = sUId;
        dt.Rows.Add(dr1);

        DataRow dr2 = dt.NewRow();
        dr2[0] = "UName";
        dr2[1] = sUName;
        dt.Rows.Add(dr2);

        DataRow dr3 = dt.NewRow();
        dr3[0] = "Ip";
        dr3[1] = Request.ServerVariables["REMOTE_ADDR"];
        dt.Rows.Add(dr3);

        DataRow dr4 = dt.NewRow();
        dr4[0] = "AddTime";
        dr4[1] = DateTime.Now.ToString();
        dt.Rows.Add(dr4);

        #endregion

        //以下是自动添加字段获得值
        for (int i = 0; i < dtInfo.Rows.Count; i++)
        {
            DataRow dr = dt.NewRow();
            dr[0] = dtInfo.Rows[i]["Name"].ToString();

            switch (dtInfo.Rows[i]["Type"].ToString())
            {
                case "ListBoxType":
                    if (Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""] == "" || Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""] == null)
                    {
                        dr[1] = Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""];
                    }
                    else
                    {
                        dr[1] = Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""].Replace(" ", "").ToString();
                    }
                    break;
                case "MultipleTextType":
                    dr[1] = Function.Encode(Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""]);
                    break;
                default:
                    dr[1] = Request.Form["txt_" + dtInfo.Rows[i]["Name"].ToString() + ""];
                    break;
            }
            dt.Rows.Add(dr);
        }

        //添加信息
        BInfoModel.AddInfoModel(dt, TableName);
        dtInfo.Clear();
        dtInfo.Dispose();
        Function.ShowMsg(1, "<li>成功添加!</li><li><a href='info/InfoCustomForm.aspx?CustomFormId=" + CustomFormId + "'>返回发布页面</a></li>");
    }
예제 #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(33);
        Response.Cache.SetNoStore();

        if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"]))
        {
            try
            {
                CustomFormId = int.Parse(Request.QueryString["CustomFormId"]);
            }
            catch { }
        }

        if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
        {
            try
            {
                Id = int.Parse(Request.QueryString["Id"]);
            }
            catch { }
        }

        MCustomForm = BCustomForm.GetModel(CustomFormId);

        drinfo = BInfoOper.GetInfo(MCustomForm.TableName, Id);

        FieldName = Request.QueryString["FieldName"];

        if (!Page.IsPostBack)
        {

            MCustomFormField = BCustomFormField.GetModel(CustomFormId, FieldName);
            FormName.Text = MCustomForm.FormName;

            Alias.Text = "" + MCustomFormField.Alias + ":";
            ShowStyle.Text = GetShowStyle(MCustomFormField.Name, MCustomFormField.IsNotNull.ToString(), MCustomFormField.Type, MCustomFormField.Content, MCustomFormField.Description);
        }
    }