当前位置: 首页>>代码示例>>C#>>正文


C# Student.UpdateOldStudent方法代码示例

本文整理汇总了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();
        }
    }
开发者ID:mominbd,项目名称:testing,代码行数:74,代码来源:Update.aspx.cs


注:本文中的Student.UpdateOldStudent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。