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"); }
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"); }