示例#1
0
        public EduField FindByEduFieldID(string username, string password, int id)
        {
            WebServiceAccountsRepository webir       = new WebServiceAccountsRepository();
            WebServiceAccount            currentuser = webir.FindByUserName(username);

            if (currentuser != null)
            {
                if (currentuser.Password == password)
                {
                    EduFieldsRepository depir = new EduFieldsRepository();
                    return(depir.FindByid(id));
                }
                else
                {
                    return(null);
                }
            }

            else
            {
                return(null);
            }
        }
        public void LoadFieldData(string Fieldid)
        {
            try
            {
                EduFieldsRepository efir  = new EduFieldsRepository();
                EduField            field = efir.FindByid(Fieldid.ToInt());

                if (field != null)
                {
                    lbltitle.Text = field.FieldTitle;

                    lblFieldid.Text = field.FieldID.ToString();
                    TextBox1.Text   = field.FieldTitle;
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }