Exemple #1
0
        protected void btn_Del_Click(object sender, EventArgs e)
        {
            string ids = WS.RequestString("id");

            UserFormView.Del(string.Format("id in ({0})", ids));
            Js.AlertAndChangUrl("删除成功!", "UserFormList.aspx");
        }
Exemple #2
0
        protected void LoadInfo()
        {
            int      id = WS.RequestInt("id");
            UserForm f  = UserFormView.GetModelByID(id.ToS());

            if (f.ID < 0)
            {
                return;
            }
            txt_FormName.Text = f.FormName;
            txt_Content.Text  = f.Content;
        }
Exemple #3
0
        protected void uploadFile(object sender, EventArgs e)
        {
            // Using FindControl and a Casting to get the fileupload values
            FileUpload fl1 = ((FileUpload)UserFormView.FindControl("photoFile"));

            if (fl1.FileName != null && fl1.FileContent.Length > 0)
            {
                string folderPath = Server.MapPath("~/Resources/Uploads/");
                fl1.SaveAs(folderPath + Path.GetFileName(fl1.FileName));
                ((TextBox)UserFormView.FindControl("photoTextBox")).Text = fl1.FileName;
            }
        }
Exemple #4
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            int      id = WS.RequestInt("id");
            UserForm f  = UserFormView.GetModelByID(id.ToS());

            f.FormName = txt_FormName.Text;
            f.Content  = txt_Content.Text.TrimDbDangerousChar();

            if (f.ID > 0)
            {
                UserFormView.Update(f);
            }
            else
            {
                UserFormView.Insert(f);
            }

            Js.AlertAndChangUrl("保存成功!", "UserFormList.aspx");
        }
        private void OnShowUserForm(object sender, RoutedEventArgs e)
        {
            var window = new Window();
             var view = new UserFormView();

             Action<Person> onSubmit = p =>
             {
            window.Close();
            MessageBox.Show(string.Format("{0} (aged: {1} years) added!", p.Name, p.Age));
             };

             Action onCancel = window.Close;

             var viewModel = new UserForm("Add user", onSubmit, onCancel);
             view.DataContext = viewModel;
             window.Content = view;
             window.Show();
             window.BringIntoView();
        }
Exemple #6
0
        protected void LoadInfo()
        {
            ddl_RegForm.DataSource     = UserFormView.GetModelList();
            ddl_RegForm.DataTextField  = "FormName";
            ddl_RegForm.DataValueField = "ID";
            ddl_RegForm.DataBind();

            int id = WS.RequestInt("id");

            Voodoo.Model.UserGroup g = UserGroupView.GetModelByID(id.ToS());
            if (g.ID < 0)
            {
                return;
            }
            txt_GroupName.Text        = g.GroupName;
            txt_grade.Text            = g.Grade.ToS();
            txt_MaxPost.Text          = g.MaxPost.ToS();
            chk_PostAotuAudit.Checked = g.PostAotuAudit;
            chk_EnableReg.Checked     = g.EnableReg;
            chk_RegAutoAudit.Checked  = g.RegAutoAudit;
            ddl_RegForm.SelectedValue = g.RegForm.ToS();
        }
        public void ExecuteAddCommand(object parameter)
        {
            UserFormView userFormView = new UserFormView();

            userFormView.Show();
        }
        public void ExecuteEditCommand(object parameter)
        {
            UserFormView userFormView = new UserFormView(SelectedUser);

            userFormView.Show();
        }
Exemple #9
0
 protected void BindData()
 {
     rp_list.DataSource = UserFormView.GetModelList();
     rp_list.DataBind();
 }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int formID = UserGroupView.GetModelByID(WS.RequestString("group")).RegForm;

            formString = UserFormView.GetModelByID(formID.ToS()).Content;
        }
Exemple #11
0
 protected void NewItem_Command(object sender, CommandEventArgs e)
 {
     UserFormView.ChangeMode(FormViewMode.Insert);
     // getStatus((DropDownList)UserFormView.FindControl("DropDownListStatus"));
     gridViewPanel.Visible = false;
 }
Exemple #12
0
 protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     UserEditDataSource.SelectParameters["Id"].DefaultValue = UserGridView.SelectedValue.ToString();
     UserFormView.DataBind();
     gridViewPanel.Visible = false;
 }