protected void bt_SaveArchives_Click(object sender, EventArgs e) { strStudentID = lbStudentID.Text.Trim(); if (txtFileCreateTime.Text.Trim() == String.Empty) { txtFileCreateTime.Text = "1900/1/1"; } if (txtFileSendTime.Text.Trim() == String.Empty) { txtFileSendTime.Text = "1900/1/1"; } if (txtGradutaionTime.Text.Trim() == String.Empty) { txtGradutaionTime.Text = "1900/1/1"; } if (txtStoreFileStartTime.Text.Trim() == String.Empty) { txtStoreFileStartTime.Text = "1900/1/1"; } if (!StudentFileEx.UpdateStudentArchives(Convert.ToInt16(DropDownListMemberInfo.SelectedValue), Convert.ToInt16(DropDownListPartyMemberInfo.SelectedValue), txtFileCreateTime.Text.Trim(), txtFileSource.Text.Trim(), txtFileSourceType.Text.Trim(), txtGradutaionTime.Text.Trim(), txtFileSendTime.Text.Trim(), txtFileSendCompany.Text.Trim(), txtFileSendCompanyAddress.Text.Trim(), txtFileSendCompanyPost.Text.Trim(), txtFileSendCompanyContact.Text.Trim(), txtFileSendCompanyPhone.Text.Trim(), txtFileSendCompanyType.Text.Trim(), Convert.ToInt16(DropDownListStoreFile.SelectedValue), txtStoreFileStartTime.Text.Trim(), strStudentID)) { lbErrorMessage.Visible = true; lbErrorMessage.Text = "更新失败!"; return; } lbErrorMessage.Visible = true; lbErrorMessage.Text = "更新成功!"; }
private void InitializeControl() { DataSet QuestRS = StudentFileEx.SelectSingleStudentFileInfo(strStudentID); lbStudentID.Text = strStudentID; lbName.Text = CheckContent(QuestRS.Tables[0].Rows[0][0]); lbNativeProvince.Text = CheckContent(QuestRS.Tables[0].Rows[0][1]); lbStudentSource.Text = CheckContent(QuestRS.Tables[0].Rows[0][2]); DropDownListPoliticalStatus.SelectedValue = CheckDropDownListView(DropDownListPoliticalStatus, QuestRS.Tables[0].Rows[0][3]); DropDownListMemberInfo.SelectedValue = CheckDropDownListView(DropDownListMemberInfo, QuestRS.Tables[0].Rows[0][4]); DropDownListPartyMemberInfo.SelectedValue = CheckDropDownListView(DropDownListPartyMemberInfo, QuestRS.Tables[0].Rows[0][5]); txtFileCreateTime.Text = DateStringFomate(CheckContent(QuestRS.Tables[0].Rows[0][6])); txtFileSource.Text = CheckContent(QuestRS.Tables[0].Rows[0][7]); txtFileSourceType.Text = CheckContent(QuestRS.Tables[0].Rows[0][8]); txtGradutaionTime.Text = DateStringFomate(CheckContent(QuestRS.Tables[0].Rows[0][9])); txtFileSendTime.Text = DateStringFomate(CheckContent(QuestRS.Tables[0].Rows[0][10])); txtFileSendCompany.Text = CheckContent(QuestRS.Tables[0].Rows[0][11]); txtFileSendCompanyAddress.Text = CheckContent(QuestRS.Tables[0].Rows[0][12]); txtFileSendCompanyPost.Text = CheckContent(QuestRS.Tables[0].Rows[0][13]); txtFileSendCompanyContact.Text = CheckContent(QuestRS.Tables[0].Rows[0][14]); txtFileSendCompanyPhone.Text = CheckContent(QuestRS.Tables[0].Rows[0][15]); txtFileSendCompanyType.Text = CheckContent(QuestRS.Tables[0].Rows[0][16]); DropDownListStoreFile.SelectedValue = CheckDropDownListView(DropDownListStoreFile, QuestRS.Tables[0].Rows[0][17]); txtStoreFileStartTime.Text = DateStringFomate(CheckContent(QuestRS.Tables[0].Rows[0][18])); }
protected void btAdd_Click(object sender, EventArgs e) { if (txtStudentID.Text.Trim() == String.Empty) { lbErrorMessage.Text = "请输入学号后按添加!"; return; } String SelectId = txtStudentID.Text.Trim(); if (StudentFileEx.CheckStudent(SelectId)) { lbErrorMessage.Text = "该学生已存在!"; return; } if (!StudentFileEx.CheckStudentTable(SelectId)) { lbErrorMessage.Text = "该学生尚未注册!"; return; } if (!StudentFileEx.InsertStudentFile(SelectId)) { lbErrorMessage.Text = "数据插入失败!"; return; } String strurl = "http://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath; if (!strurl.EndsWith("/")) { strurl += "/"; } strurl += "StudentFile/StudentFileBasicInfo.aspx" + "?id=" + SelectId + "&Type=add"; Response.Redirect(strurl); }
public void Rebind(String ID, String strName) { DataSet Rs = StudentFileEx.SelectStudentFileQuery(ID, strName); this.GridviewFile.DataSource = Rs; GridviewFile.DataBind(); }
public void Rebind() { DataSet Rs = StudentFileEx.SelectAllStudentFile(); this.GridviewFile.DataSource = Rs; GridviewFile.DataBind(); }
private void GridViewArchivesNewBind() { strStudentID = lbStudentID.Text.Trim(); DataSet ArchivesNewRs = StudentFileEx.SelectStudentArchivesNew(strStudentID); this.GridViewArchivesNew.DataSource = ArchivesNewRs; this.GridViewArchivesNew.DataBind(); }
private void GridViewFileBind() { strStudentID = lbStudentID.Text.Trim(); DataSet QueryRS = StudentFileEx.SelectStudentArchivesContent(strStudentID); this.GridViewFile.DataSource = QueryRS; GridViewFile.DataBind(); }
protected void OnRowDeleting(object sender, GridViewDeleteEventArgs e) { int index = e.RowIndex; String SelectId = this.GridviewFile.DataKeys[index].Value.ToString().Trim(); if (!StudentFileEx.DeleteStudentFile(SelectId)) { lbErrorMessage.Text = "删除失败!"; return; } lbErrorMessage.Text = "删除成功!"; Rebind(); }
protected void ArchivesNewOnRowDeleting(object sender, GridViewDeleteEventArgs e) { strStudentID = lbStudentID.Text.Trim(); int index = e.RowIndex; String SelectedID = this.GridViewArchivesNew.DataKeys[index].Value.ToString().Trim(); if (!StudentFileEx.DeleteArchivesNew(Convert.ToInt64(SelectedID), strStudentID)) { lbErrorMessage.Visible = true; lbErrorMessage.Text = "删除失败!"; return; } lbErrorMessage.Visible = true; lbErrorMessage.Text = "删除成功!"; GridViewArchivesNewBind(); }
protected void bt_AddArchivesNew_Click(object sender, EventArgs e) { strStudentID = lbStudentID.Text.Trim(); if (txtAddTime.Text.Trim() == String.Empty) { lbErrorMessage.Visible = true; lbErrorMessage.Text = "添加时间不可为空!"; return; } if (!StudentFileEx.InsertArchivesNew(txtAddTime.Text.Trim(), txtArchivesNewContent.Text.Trim(), txtAddPeople.Text.Trim(), txtArchivesNewRemark.Text.Trim(), strStudentID)) { lbErrorMessage.Visible = true; lbErrorMessage.Text = "添加失败!"; return; } lbErrorMessage.Visible = true; lbErrorMessage.Text = "添加成功!"; GridViewArchivesNewBind(); }
protected void btFileSave_Click(object sender, EventArgs e) { if (txtContentTitle.Text.Trim() == String.Empty) { lbErrorMessage.Visible = true; lbErrorMessage.Text = "标题不可为空!"; return; } strStudentID = lbStudentID.Text.Trim(); if (!StudentFileEx.InsertStudentArchivesContent(txtContentTitle.Text.Trim(), txtFileContent.Text.Trim(), txtFileRemark.Text.Trim(), strStudentID)) { lbErrorMessage.Visible = true; lbErrorMessage.Text = "插入失败!"; return; } lbErrorMessage.Visible = true; lbErrorMessage.Text = "插入成功!"; GridViewFileBind(); }