internal LostFoundsModel LostFoundDetails(LostFoundsModel lostFound) { AddParameter("@lostfoundid", lostFound.LostFoundID); DataTable Dt_LostFoundDetails = this.GetDataTable("usp_GetLostFoundDetails"); if (Dt_LostFoundDetails.Rows.Count > 0) { foreach (DataRow dr in Dt_LostFoundDetails.Rows) { lostFoundDetails = new LostFoundsModel(); lostFoundDetails.LostFoundID = Convert.ToInt64(dr["LostFoundID"].ToString()); lostFoundDetails.LostWhat = dr["LostWhat"].ToString(); lostFoundDetails.LostWhen = dr["LostWhen"].ToString(); lostFoundDetails.LostAt = dr["LostAt"].ToString(); lostFoundDetails.FoundWhat = dr["FoundWhat"].ToString(); lostFoundDetails.FoundWhen = dr["FoundWhen"].ToString(); lostFoundDetails.FoundAt = dr["FoundAt"].ToString(); lostFoundDetails.Description = dr["Description"].ToString(); lostFoundDetails.CreatedUserID = Convert.ToInt64(dr["CreatedUserID"].ToString()); lostFoundDetails.CreatedRoleID = Convert.ToByte(dr["CreatedRoleID"].ToString()); lostFoundDetails.CreatedOn = Convert.ToDateTime(dr["CreatedOn"].ToString()); if (!String.IsNullOrEmpty(dr["ModifiedOn"].ToString())) { lostFoundDetails.ModifiedUserID = Convert.ToInt64(dr["ModifiedUserID"].ToString()); lostFoundDetails.ModifiedRoleID = Convert.ToByte(dr["ModifiedRoleID"].ToString()); lostFoundDetails.ModifiedOn = Convert.ToDateTime(dr["ModifiedOn"].ToString()); } } } return lostFoundDetails; }
internal Object DeleteLostFound(LostFoundsModel lostFound) { AddParameter("@lostfoundid", lostFound.LostFoundID); AddParameter("@modifieduserid", lostFound.ModifiedUserID); AddParameter("@modifiedroleid", lostFound.ModifiedRoleID); AddParameter("@modifiedon", lostFound.ModifiedOn); return ExecuteScalar("usp_DeleteLostFound"); }
internal object AddLostFound(LostFoundsModel lostFound) { AddParameter("@communityid",lostFound.CommunityID); AddParameter("@lostwhat", lostFound.LostWhat); AddParameter("@lostwhen", lostFound.LostWhen); AddParameter("@lostat", lostFound.LostAt); AddParameter("@foundwhat", lostFound.FoundWhat); AddParameter("@foundwhen", lostFound.FoundWhen); AddParameter("@foundat", lostFound.FoundAt); AddParameter("@description", lostFound.Description); AddParameter("@createduserid", lostFound.CreatedUserID); AddParameter("@createdroleid", lostFound.CreatedRoleID); AddParameter("@createdon", lostFound.CreatedOn); return this.ExecuteScalar("usp_AddLostFound"); }
public ActionResult NewLostFound(LostFoundsModel lfm) { if (this.ModelState.IsValid) { lfm.CreatedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString()); lfm.CreatedOn = Convert.ToDateTime(DateTime.Now.ToShortDateString()); return Json(lostFoundsDAL.AddLostFound(lfm).ToString()); } else return Json("ModelError"); }
public ActionResult NewLostFound() { lostFound = new LostFoundsModel(); lostFound.CommunityID = myCommunityID; return PartialView("Partials/LostFounds/NewLostFound", lostFound); }
public PartialViewResult LostFoundsListTable() { lostFound = new LostFoundsModel(); lostFound.CommunityID = myCommunityID; lostFoundsDAL = new LostFoundsDAL(); ViewBag.LostFoundsList = lostFoundsDAL.LostFoundList(lostFound); return PartialView("Partials/LostFounds/LostFoundsListTable"); }
public ActionResult LostFounds() { lostFound = new LostFoundsModel(); lostFound.CommunityID = myCommunityID; lostFoundsDAL = new LostFoundsDAL(); ViewBag.LostFoundsList = lostFoundsDAL.LostFoundList(lostFound); return View("LostFounds"); }
public ActionResult LostFoundDetails(String lostfoundid) { lostFound = new LostFoundsModel(); lostFound.CommunityID = myCommunityID; lostFound.LostFoundID = Convert.ToInt64(lostfoundid.ToString()); lostFoundsDAL = new LostFoundsDAL(); ViewBag.LostFoundDetails = lostFoundsDAL.LostFoundDetails(lostFound); return View(); }
public ActionResult UpdateLostFound(FormCollection fc, LostFoundsModel lostFound) { if (Request.IsAjaxRequest()) { if (this.ModelState.IsValid) { //lostFound.ModifiedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString()); //lostFound.ModifiedOn = Convert.ToDateTime(DateTime.Now.ToShortDateString()); //lostFoundsDAL.UpdateLostFound(lostFound); return Json("success"); } else return Json("dataerror", JsonRequestBehavior.AllowGet); } else return Json("ajaxerror", JsonRequestBehavior.AllowGet); }
internal List<LostFoundsModel> LostFoundList(LostFoundsModel lostFound) { AddParameter("@communityid", lostFound.CommunityID); DataTable Dt_LostFoundList = this.GetDataTable("usp_GetLostFoundsList"); lostFoundList = new List<LostFoundsModel>(); if (Dt_LostFoundList.Rows.Count > 0) { foreach (DataRow dr in Dt_LostFoundList.Rows) { lostFoundObj = new LostFoundsModel(); lostFoundObj.LostFoundID = Convert.ToInt64(dr["LostFoundID"].ToString()); lostFoundObj.CommunityID = Convert.ToInt16(dr["CommunityID"].ToString()); lostFoundObj.LostWhat = dr["LostWhat"].ToString(); lostFoundObj.LostWhen = dr["LostWhen"].ToString(); lostFoundObj.LostAt = dr["LostAt"].ToString(); lostFoundObj.FoundWhat = dr["FoundWhat"].ToString(); lostFoundObj.FoundWhen = dr["FoundWhen"].ToString(); lostFoundObj.FoundAt = dr["FoundAt"].ToString(); lostFoundObj.Description= dr["Description"].ToString(); lostFoundObj.CreatedUserID = Convert.ToInt64(dr["CreatedUserID"].ToString()); lostFoundObj.CreatedRoleID = Convert.ToByte(dr["CreatedRoleID"].ToString()); lostFoundObj.CreatedOn = Convert.ToDateTime(dr["CreatedOn"].ToString()); if (!String.IsNullOrEmpty(dr["ModifiedOn"].ToString())) { lostFoundObj.ModifiedUserID = Convert.ToInt64(dr["ModifiedUserID"].ToString()); lostFoundObj.ModifiedRoleID = Convert.ToByte(dr["ModifiedRoleID"].ToString()); lostFoundObj.ModifiedOn = Convert.ToDateTime(dr["ModifiedOn"].ToString()); } lostFoundList.Add(lostFoundObj); } } return lostFoundList; }
internal LostFoundsModel EditLostFound(LostFoundsModel lostFound) { return this.LostFoundDetails(lostFound); }
public ActionResult LostFoundsList(String communityid) { lostFound = new LostFoundsModel(); lostFound.CommunityID = outCommunityID; lostFoundsDAL = new LostFoundsDAL(); ViewBag.LostFoundsList = lostFoundsDAL.LostFoundList(lostFound); return View("Partials/LostFounds/LostFoundsList"); }