Esempio n. 1
0
        public ActionResult Delete(int id)
        {
            StudentDAL dal    = new StudentDAL();
            bool       status = dal.Delete(id);

            return(View());
        }
 public void Delete(long id)
 {
     try
     {
         dal.Delete(id);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 3
0
 public bool Delete(long id, long person)
 {
     try
     {
         var update = studentDAL.Delete(id, person);
         return(update);
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Method to Update AFC status For Student
        /// </summary>
        /// <param name="argEn">Student Entity is an Input.</param>
        /// <returns>Returns Boolean</returns>
        //public bool UpdateAFC(StudentEn argEn)
        //{
        //        try
        //        {
        //            StudentDAL loDs = new StudentDAL();
        //            return loDs.UpdateAfc(argEn);
        //        }
        //        catch (Exception ex)
        //        {

        //            throw ex;
        //        }
        //}
        /// <summary>
        /// Method to Delete Student
        /// </summary>
        /// <param name="argEn">Student Entity is an Input.MatricNo as Input Property.</param>
        /// <returns>Returns Boolean</returns>
        public bool Delete(StudentEn argEn)
        {
            try
            {
                StudentDAL loDs = new StudentDAL();
                return(loDs.Delete(argEn));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            StudentDAL stuDal = new StudentDAL();


            var lstStu = stuDal.QueryList();//查询返回列表

            Console.WriteLine("查询返回列表如下:");
            foreach (var stu in lstStu)
            {
                Console.WriteLine(stu.ToString());
            }


            Student stuInfo = new Student();

            stuInfo.StuID = 112;
            Console.WriteLine("查询返回实体如下:");
            var resultQuery = stuDal.QueryList(stuInfo.StuID);//查询返回实体

            Console.WriteLine(resultQuery.ToString());


            Student stuInfo1 = new Student();

            stuInfo1.StuID    = 115;
            stuInfo1.StuName  = "王尼玛";
            stuInfo1.Birthday = Convert.ToDateTime("1998-02-24");
            int resultInsert = stuDal.Insert(stuInfo1);//插入单条数据

            List <Student> lsStudents = new List <Student>();

            lsStudents.Add(stuInfo1);
            Student stuInfo2 = new Student();

            stuInfo2.StuID    = 116;
            stuInfo2.StuName  = "许文强";
            stuInfo2.Birthday = Convert.ToDateTime("1995-12-24");
            lsStudents.Add(stuInfo2);
            int resultBatchInsert = stuDal.BatchInsert(lsStudents);                        //批量插入数据

            int resultDelete = stuDal.Delete(stuInfo1);                                    //删除

            int resultUpdate = stuDal.Update(115, "傻根", Convert.ToDateTime("1993-06-22")); //更新

            stuDal.Transaction();                                                          //事务


            Console.ReadLine();
        }
Esempio n. 6
0
 public string Delete(int id)
 {
     try
     {
         if (id < 1)
         {
             return("Geçerli Bir Öğrenci Seçiniz");
         }
         return(studentDAL.Delete(id));
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Esempio n. 7
0
        public void DeleteStudent(DTO dto, out string _status)
        {
            bool _canInsert = ValidateString(dto.Name);

            if (_canInsert)
            {
                Student student = new Student();
                student.Name      = dto.Name;
                student.RollNo    = dto.RollNo;
                student.StudentID = dto.StudentID;
                studentDAL.Delete(student, out _status);
            }
            else
            {
                _status = "Name invalid. Should contain alphabets more than 2";
            }
        }
Esempio n. 8
0
        public List <Student> Remove(string studName)
        {
            List <Student> stud = new List <Student>();

            try
            {
                stud = Dal.Delete(studName);
            }
            catch (StudentExcpetion ex1)
            {
                throw ex1;
            }
            catch (Exception ex2)
            {
                throw ex2;
            }
            return(stud);
        }
Esempio n. 9
0
 public static List<Student> Delete(int id = 0)
 {
     StudentDAL obj = new StudentDAL();
     return obj.Delete(id);
 }
Esempio n. 10
0
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     StudentDAL.Delete(Convert.ToInt32(textBoxStudentID.Text));
     MessageBox.Show("Student record has been deleted", "Confirmation");
 }
Esempio n. 11
0
 public static bool Delete(object a)
 {
     return(StudentDAL.Delete(a));
 }
Esempio n. 12
0
 public static bool Delete(string a)
 {
     return(StudentDAL.Delete(a));
 }
Esempio n. 13
0
 public bool Delete(int id)
 {
     return(StudentDAL.Delete(id));
 }
Esempio n. 14
0
        public void Delete(int id)
        {
            StudentDAL dalObject = new StudentDAL();

            dalObject.Delete(id);
        }