Example #1
0
        private void RemoveStaff(object o)
        {
            StaffModel s = o as StaffModel;

            AddedStaff.Remove(s);
            IUDFlag = "D";
            StaffID = s.StaffID.Trim();
            IUD();
            //counter--;
        }
Example #2
0
 private void AddStaff()
 {
     if (!string.IsNullOrEmpty(this.SelectedStaff))
     {
         string[] arr = this.SelectedStaff.Split(':');
         if (arr.Length > 1)
         {
             string     userid    = arr[1];
             string     staffname = arr[0];
             StaffModel obj       = new StaffModel();
             obj.StaffName = staffname;
             obj.StaffID   = userid;
             obj.Command   = new DelegateCommand(RemoveStaff);
             obj.Parameter = obj;
             AddedStaff.Add(obj);
             this.SelectedStaff = string.Empty;
             counter++;
             IUDFlag      = "I";
             this.StaffID = obj.StaffID.Trim();
             IUD();
         }
     }
 }
Example #3
0
 void GetStaffClassMapping()
 {
     try
     {
         string        sql = "exec [SMS].[GetStaffClassMapping]";
         List <string> lst = new List <string>();
         lst.Add(SelectedClassRoom.StaticID.ToString());
         lst.Add(Schoolid);
         DataTable dt = DAL.Select(sql, lst);
         AddedStaff = new ObservableCollection <StaffModel>();
         foreach (DataRow dr in dt.Rows)
         {
             StaffModel obj = new StaffModel();
             obj.StaffName = dr["staffname"].ToString();
             obj.StaffID   = dr["StaffID"].ToString();
             obj.Command   = new DelegateCommand(RemoveStaff);
             obj.Parameter = obj;
             AddedStaff.Add(obj);
         }
     }
     catch (Exception ex)
     {
     }
 }