public ActionResult PersonList() { DAL.DataAccess.CallingDAL.CommonDA CDA = new DAL.DataAccess.CallingDAL.CommonDA(); DataTable DTPersons = new DataTable(); var plist = new List <PersonListModel>(); if (GlobalInfo.RoleID == 9) { DTPersons = CDA.GetPersonsList(0, GlobalInfo.OID); for (int i = 0; i < DTPersons.Rows.Count; i++) { var p = new PersonListModel(); p.FirstName = DTPersons.Rows[i]["FirstName"].ToString(); p.MiddleName = DTPersons.Rows[i]["MiddleName"].ToString(); p.LastName = DTPersons.Rows[i]["LastName"].ToString(); p.DateofBirth = DTPersons.Rows[i]["DOB"].ToString(); p.PersonID = Convert.ToInt32(DTPersons.Rows[i]["PersonID"]); p.Telephone = DTPersons.Rows[i]["PhonePersonal"].ToString(); p.Mobile = DTPersons.Rows[i]["MobilePersonal"].ToString(); p.EmailAddress = DTPersons.Rows[i]["EmailPersonal"].ToString(); p.IsMember = Convert.ToBoolean(DTPersons.Rows[i]["IsMember"]); plist.Add(p); } } ViewBag.PersonList = plist; return(View()); }
public string Get() { DAL.DataAccess.CallingDAL.CommonDA CDA = new DAL.DataAccess.CallingDAL.CommonDA(); DataTable DTPersons = new DataTable(); string data = ""; DTPersons = CDA.GetPersonsList(0, GlobalInfo.OID); for (int i = 0; i < DTPersons.Rows.Count; i++) { var p = new PersonListModel(); p.FirstName = DTPersons.Rows[i]["FirstName"].ToString(); p.MiddleName = DTPersons.Rows[i]["MiddleName"].ToString(); p.LastName = DTPersons.Rows[i]["LastName"].ToString(); p.DateofBirth = DTPersons.Rows[i]["DOB"].ToString(); p.PersonID = Convert.ToInt32(DTPersons.Rows[i]["PersonID"]); p.Telephone = DTPersons.Rows[i]["PhonePersonal"].ToString(); p.Mobile = DTPersons.Rows[i]["MobilePersonal"].ToString(); p.EmailAddress = DTPersons.Rows[i]["EmailPersonal"].ToString(); p.IsMember = Convert.ToBoolean(DTPersons.Rows[i]["IsMember"]); data += p.FirstName + "," + p.LastName + "," + p.PersonID + "," + p.Telephone; } return(data); }
public ActionResult PersonList(string personid, int ischecked) { /*do something with the data*/ DAL.DataAccess.CallingDAL.CommonDA CDA = new DAL.DataAccess.CallingDAL.CommonDA(); CDA.ModifyMemebrShipStatus(Convert.ToInt32(personid), GlobalInfo.OID, Convert.ToBoolean(ischecked)); string message = "done"; return(Json(new PersonListModel { Message = message })); }
public ActionResult Dologin(Login log) { if (ModelState.IsValid) { DAL.DataAccess.CallingDAL.CommonDA CDA = new DAL.DataAccess.CallingDAL.CommonDA(); DataTable DTLoginInfo = CDA.ValidateUserLogin(log.Username, log.Password, GlobalInfo.OID); if (DTLoginInfo.Rows.Count > 0) { GlobalInfo.LoginInfo = DTLoginInfo.Rows[0]; GlobalInfo.IsLoggedIN = true; GlobalInfo.PersonID = Convert.ToInt32(DTLoginInfo.Rows[0]["PersonID"]); GlobalInfo.RoleID = Convert.ToInt32(DTLoginInfo.Rows[0]["RoleID"]); /*add login information to session*/ Session.Add("DTLogin", DTLoginInfo); /*Set form authentication*/ FormsAuthentication.SetAuthCookie(log.Username, false); if (GlobalInfo.LoginInfo["RoleID"].ToString() == "9") { return(RedirectToAction("Index", "SuperUserDB")); } else if (GlobalInfo.LoginInfo["RoleID"].ToString() == "8") { /*Redirect to Admin DashBoard*/ } else if (GlobalInfo.LoginInfo["RoleID"].ToString() == "7") { /*Redirect to Register user Dashboard*/ } } } return(View()); }
public bool LoadOrganizationInfo(string OID) { /*Entity Framework testing*/ var persons = new CeuEntities(); var data = persons.tbl_Person.FirstOrDefault(x => x.PersonID == 1); var data1 = from p in persons.tbl_Person where p.PersonID == 1 select p; /*xxx*/ string OrgCode = OID; DAL.DataAccess.CallingDAL.CommonDA CDAL = new DAL.DataAccess.CallingDAL.CommonDA(); string OrganizationName = CDAL.GetOrganizationName(OID); int orgId = 0; if (!string.IsNullOrEmpty(OrganizationName)) { string[] str = OrganizationName.Split('|'); string OName = str[0]; int status = Convert.ToInt32(str[1]); orgId = Convert.ToInt32(str[3]); string orgAddress = str[4]; string EmailAddress = str[5]; string RegistrationMethod = str[6]; // string Zipcode = str[7]; if (str[2] == "1") { //new ViewModelLocator().Main.AllowMemberShip = true; } else { // new ViewModelLocator().Main.AllowMemberShip = false; } if (status == 2) { //new ViewModelLocator().Main.AllowMemberLogin = true; } else { //new ViewModelLocator().Main.AllowMemberLogin = false; } //if (status == 2) //{ //new ViewModelLocator().LoginForm.OrganizationName = ea.Result; // busyIndicator.Content = new MainPage(); // LoadImage(orgId); GlobalInfo.OrgName = OName;//ea.Result; GlobalInfo.OID = orgId; GlobalInfo.OrgCode = OrgCode; GlobalInfo.OrgAddress = orgAddress; GlobalInfo.OrgEmailAddress = EmailAddress; GlobalInfo.RegMethod = RegistrationMethod; return(true); } else { return(false); } }