Beispiel #1
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        int conferenceCode;
        ConferenceManageBFL   cmBFL   = new ConferenceManageBFL();
        ConferenceManageModel cmModel = new ConferenceManageModel();

        AspWebControl.Calendar startDate = (AspWebControl.Calendar)(this.FormView1.FindControl("startDate"));
        AspWebControl.Calendar endDate   = (AspWebControl.Calendar)(this.FormView1.FindControl("endDate"));
        DropDownList           ddlType   = (DropDownList)(this.FormView1.Row.FindControl("DropDownListType"));

        ucDept = (RmsPM.Web.UserControls.InputUnit)(this.FormView1.Row.FindControl("Inputunit1"));
        //DropDownList ddlDept = (DropDownList)(this.FormView1.Row.FindControl("DropDownListDept"));
        TextBox tbxTopic   = (TextBox)(this.FormView1.FindControl("TextBoxTopic"));
        TextBox tbxCharter = (TextBox)(this.FormView1.FindControl("TextBoxChaterMember"));
        TextBox tbxRemark  = (TextBox)(this.FormView1.FindControl("TextBoxRemark"));
        TextBox tbxPlace   = (TextBox)(this.FormView1.FindControl("TextBoxPlace"));

        cmModel.ChaterMember = tbxCharter.Text;
        cmModel.Dept         = ucDept.Text;
        cmModel.EndTime      = DateTime.Parse(endDate.Value);
        cmModel.Place        = tbxPlace.Text;
        cmModel.Remark       = tbxRemark.Text;
        cmModel.StartTime    = DateTime.Parse(startDate.Value);
        cmModel.State        = "未通过";
        cmModel.Topic        = tbxTopic.Text;
        cmModel.Type         = ddlType.SelectedItem.Text;
        conferenceCode       = cmBFL.Insert(cmModel);
        this.ucadd           = (RmsPM.Web.UserControls.AttachMentAdd)(this.FormView1.Row.FindControl("Attachmentadd1"));
        ucadd.SaveAttachMent(conferenceCode.ToString());
        this.SaveDataIntoUserList("Attend", conferenceCode);
        this.SaveDataIntoUserList("OtherAttend", conferenceCode);
        Response.Redirect("ConferenceWeek.aspx");
    }
    protected void AccountFormView_ItemInserting(object sender, FormViewInsertEventArgs e)
    {
        DropDownList ddlType  = (DropDownList)(this.AccountFormView.Row.FindControl("TypeDropDownList"));
        TextBox      tbx      = (TextBox)(this.AccountFormView.Row.FindControl("PriceTextBox"));
        TextBox      tbxCount = (TextBox)(this.AccountFormView.Row.FindControl("BuyCountTextBox"));

        if (tbx.Text.Trim().Equals(String.Empty))
        {
            e.Values["Price"] = "0";
        }
        if (tbxCount.Text.Trim().Equals(String.Empty))
        {
            e.Values["BuyCount"] = "0";
        }

        if (!ddlType.SelectedIndex.Equals(0))
        {
            e.Values["Type"] = ddlType.SelectedItem.Text;
        }
        e.Values["Status"] = "0";

        RmsPM.Web.UserControls.InputUnit unit = (RmsPM.Web.UserControls.InputUnit)(this.AccountFormView.Row.FindControl("DeptTextBox"));
        if (unit.Text == "")
        {
            Response.Write(Rms.Web.JavaScript.Alert(true, "请选择部门"));
            e.Cancel = true;
        }
    }
Beispiel #3
0
    void Insert()
    {
        int conferenceCode;
        ConferenceManageBFL   cmBFL   = new ConferenceManageBFL();
        ConferenceManageModel cmModel = new ConferenceManageModel();

        AspWebControl.Calendar startDate = (AspWebControl.Calendar)(this.FormView1.FindControl("startDate"));
        AspWebControl.Calendar endDate   = (AspWebControl.Calendar)(this.FormView1.FindControl("endDate"));

        DropDownList ddlType = (DropDownList)(this.FormView1.Row.FindControl("DropDownListType"));

        ucDept = (RmsPM.Web.UserControls.InputUnit)(this.FormView1.Row.FindControl("Inputunit1"));
        TextBox     tbxTopic  = (TextBox)(this.FormView1.FindControl("TextBoxTopic"));
        TextBox     tbxRemark = (TextBox)(this.FormView1.FindControl("TextBoxRemark"));
        HiddenField hidPlace  = (HiddenField)(this.FormView1.FindControl("HidRoomCode"));

        cmModel.ChaterMember = user.UserCode;
        cmModel.Dept         = ucDept.Value;
        cmModel.Place        = hidPlace.Value;
        cmModel.Remark       = tbxRemark.Text;
        cmModel.State        = MeetStateType.UnAuthored.ToString();
        cmModel.Topic        = tbxTopic.Text;
        cmModel.Type         = ddlType.SelectedItem.Text;
        cmModel.StartTime    = cmBFL.GetUsefulDate(startDate.Value);
        cmModel.EndTime      = cmBFL.GetUsefulDate(endDate.Value);
        conferenceCode       = cmBFL.Insert(cmModel);
        this.ucadd           = (RmsPM.Web.UserControls.AttachMentAdd)(this.FormView1.Row.FindControl("Attachmentadd1"));
        ucadd.SaveAttachMent(conferenceCode.ToString());
        this.SaveDataIntoUserList("Attend", conferenceCode);
        this.SaveDataIntoUserList("OtherAttend", conferenceCode);
        Response.Redirect("XZ_ConferenceWeek.aspx");
    }
 protected void EquipmentFormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     RmsPM.Web.UserControls.InputUnit unit = (RmsPM.Web.UserControls.InputUnit)(this.EquipmentFormView.Row.FindControl("DeptTextBox"));
     if (unit.Text == "")
     {
         Response.Write(Rms.Web.JavaScript.Alert(true, "请选择部门"));
         e.Cancel = true;
     }
 }
Beispiel #5
0
    protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
    {
        RmsPM.Web.UserControls.InputUnit ucUnit = (RmsPM.Web.UserControls.InputUnit)(this.FormView1.Row.FindControl("DrawUnitInputunit"));
        if (String.IsNullOrEmpty(ucUnit.Value))
        {
            Response.Write("<script>window.alert('ÇëÑ¡ÔñÉêÇ벿ÃÅ')</script>");
            e.Cancel = true;
            return;
        }
        int code = 0;

        Int32.TryParse(Request.QueryString["ManageCode"], out code);
        e.Values["ManageCode"] = Request.QueryString["ManageCode"];
    }
    protected void AccountFormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        TextBox tbx      = (TextBox)(this.AccountFormView.Row.FindControl("PriceTextBox"));
        TextBox tbxCount = (TextBox)(this.AccountFormView.Row.FindControl("BuyCountTextBox"));

        if (tbx.Text.Trim().Equals(String.Empty))
        {
            e.NewValues["Price"] = "0";
        }
        if (tbxCount.Text.Trim().Equals(String.Empty))
        {
            e.NewValues["BuyCount"] = "0";
        }

        RmsPM.Web.UserControls.InputUnit unit = (RmsPM.Web.UserControls.InputUnit)(this.AccountFormView.Row.FindControl("DeptTextBox"));
        if (unit.Text == "")
        {
            Response.Write(Rms.Web.JavaScript.Alert(true, "请选择部门"));
            e.Cancel = true;
        }
    }