public static List <string> getStaffInCorridor(string token, System.Windows.Controls.ComboBox box) { List <string> staff = new List <string>(); try { string data = box.Text.ToString(); int index = data.LastIndexOf("ID:") + "ID:".Length; string corridorId = data.Substring(index); string json = Repository.StaffRepository.GetCorridorTeachers(corridorId, token); Models.Staffs staffs = new Models.Staffs(json); for (int i = 0; i < staffs.staffs.Count; i++) { staff.Add(staffs.staffs[i].username.ToString()); } return(staff); } catch (Exception e) { System.Windows.MessageBox.Show(e.ToString()); return(null); } }
/// <summary> /// Common function to load all tvViews /// </summary> /// <param name="dGrid"></param> /// <param name="cb_Box"></param> /// <param name="token"></param> public static void LoadTvView(DataGrid dGrid, ComboBox cb_Box, string token) { try { TvViewStaff tvView = new TvViewStaff(dGrid); List <string> listName = new List <string>(); List <string> username = new List <string>(); string data = cb_Box.Text.ToString(); int index = data.LastIndexOf("ID:") + "ID:".Length; string corridorId = data.Substring(index); string json = Repository.StaffRepository.GetCorridorTeachers(corridorId, token); Models.Staffs staffs = new Models.Staffs(json); tvView.createHeaders(); for (int i = 0; i < staffs.staffs.Count; i++) { listName.Add(staffs.staffs[i].firstname.ToString() + " " + staffs.staffs[i].lastname.ToString()); username.Add(staffs.staffs[i].username.ToString()); } for (int i = 0; i < listName.Count; i++) { string jsonn = Repository.StaffRepository.GetTeacherAvailability(username[i], token); if (jsonn == "true") { tvView.addStaff(listName[i].ToString(), true); } else { tvView.addStaff(listName[i].ToString(), false); } } } catch (Exception ee) { System.Windows.MessageBox.Show(ee.ToString()); } }
public ActionResult AddDoctor(Models.Staffs staffs) { var status = staffs.AddNewDoctor(staffs.Staff_Name, staffs.Staff_Spec_Id, staffs.Staff_Qualification, staffs.Staff_Gender, staffs.Staff_DOB_IN, staffs.Staff_BloodGroup, staffs.Staff_Email, staffs.Staff_Contact, staffs.Staff_City, staffs.Staff_State, staffs.Staff_Country, staffs.Staff_Pin); return(Json(status.ToString(), JsonRequestBehavior.AllowGet)); }