本文整理汇总了C#中Student.UpdateOldStudent方法的典型用法代码示例。如果您正苦于以下问题:C# Student.UpdateOldStudent方法的具体用法?C# Student.UpdateOldStudent怎么用?C# Student.UpdateOldStudent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student.UpdateOldStudent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
Student stu = new Student();
stu.StudentOID =Convert .ToInt32 ( ViewState["STDOID"]);
stu.StudentID = TextBoxBannerID.Text;
stu.LastName = TextLastName.Text;
if (TextLastName.Text.Length < 1)
{
lblStatus.Text = "Last Name Required";
TextLastName.Focus();
return;
}
stu.FirstName = TextFirstName.Text;
if (TextFirstName.Text.Length < 1)
{
lblStatus.Text = "First Name Required";
TextFirstName.Focus();
return;
}
stu.MiddleName = TextMiddleName.Value ;
stu.FullName = TextLastName.Text+", "+TextFirstName .Text+" "+TextMiddleName .Value ;
stu.ProgramEnrollment = TextTerm.Text;
stu.MajorProgramEnrollment = txtProgramInterest.Text;
if (TextBirthDate.Value.Length <1)
{
lblStatus.Text = "Birth Date Required";
TextBirthDate.Focus();
return;
}
if (TextBirthDate.Value!=null)
{
stu.BirthDate = Convert.ToDateTime(TextBirthDate.Value);
}
stu.PriorCreditQuestion = TextBoxPriorCredit.Text;
string status = null;
if (DropDownListStatus.Text == "Approved")
{
stu.Status = null;
status = null;
}
else
{
status = "Pending";
}
bool retValue = false;
if (stu != null)
{
retValue = stu.UpdateOldStudent(stu, status);
if (retValue == false)
{
lblStatus.Text = "Not Saved";
}
else
{
Populate(stu.StudentID);
lblStatus.Text = "Saved!";
}
}
else
{
lblStatus.Text = "Not Saved ......!";
}
}
catch (Exception ax)
{
lblStatus.Text = "Error Occured : " + ax.ToString();
}
}