예제 #1
0
        internal object AddCommunity(CommunitiesModel community)
        {
            AddParameter("@communityname", community.CommunityName);
            AddParameter("@address", community.CommunityAddress);
            AddParameter("@city", community.City);
            AddParameter("@state", community.State);
            AddParameter("@country", community.Country);
            AddParameter("@zip", community.Zip);
            AddParameter("@Phone1", community.CommunityPhone1);
            AddParameter("@Phone2", community.CommunityPhone2);
            AddParameter("@email", community.CommunityEmail);
            AddParameter("@totalunits", community.TotalUnits);
            AddParameter("@maxgates", community.MaxGates);
            AddParameter("@menuoptions", CommaSeperatedMenuOption(community.SelectedMenuOptions));
            AddParameter("@CreatedOn", community.CommunityCreatedOn);
            AddParameter("@createduserid", community.CommunityCreatedUserID);
            AddParameter("@createdroleid", community.CommunityCreatedRoleID);

            return ExecuteScalar("usp_AddCommunity");
        }
예제 #2
0
        internal List<CommunitiesModel> CommunitiesList()
        {
            DataTable Dt_CommunitiesList = GetDataTable("usp_GetCommunitiesList");
            List<CommunitiesModel> communitiesList = new List<CommunitiesModel>();
            if (Dt_CommunitiesList.Rows.Count > 0)
            {
                foreach (DataRow dr in Dt_CommunitiesList.Rows)
                {
                    CommunitiesModel communityObj; communityObj = new CommunitiesModel();
                    communityObj.CommunityID = Convert.ToInt16(dr["CommunityID"].ToString());
                    communityObj.CommunityName = dr["CommunityName"].ToString();
                    communityObj.CommunityAddress = dr["Address"].ToString();
                    communityObj.City = dr["City"].ToString();
                    communityObj.Zip = dr["Zip"].ToString();
                    communityObj.State = dr["State"].ToString();
                    communityObj.Country = dr["Country"].ToString();
                    communityObj.CommunityPhone1 = dr["Phone1"].ToString();
                    communityObj.CommunityPhone2 = dr["Phone2"].ToString();
                    communityObj.CommunityEmail = dr["Email"].ToString();
                    communityObj.TotalUnits = Convert.ToInt16(dr["TotalUnits"].ToString());
                    communityObj.MaxGates = Convert.ToByte(dr["MaxGates"].ToString());
                    communityObj.MenuOptions = dr["MenuOptions"].ToString();

                    communityObj.CommunityCreatedOn = Convert.ToDateTime(dr["CreatedOn"].ToString());
                    communityObj.CommunityCreatedUserID = Convert.ToInt64(dr["CreatedUserID"].ToString());
                    communityObj.CommunityCreatedRoleID = Convert.ToByte(dr["CreatedRoleID"].ToString());

                    if (!String.IsNullOrEmpty(dr["ModifiedOn"].ToString()))
                    {
                        communityObj.CommunityModifiedOn = Convert.ToDateTime(dr["ModifiedOn"].ToString());
                        communityObj.CommunityModifiedUserID = Convert.ToInt64(dr["ModifiedUserID"].ToString());
                        communityObj.CommunityModifiedRoleID = Convert.ToByte(dr["ModifiedRoleID"].ToString());
                    }
                    communityObj.CommunityStatus = Convert.ToChar(dr["Status"].ToString());

                    communitiesList.Add(communityObj);
                }
            }
            return communitiesList;
        }
 public ActionResult NewCommunity()
 {
     newCommunity = new CommunitiesModel();
     return PartialView("Partials/Communities/NewCommunity", newCommunity);
 }
        public ActionResult EditCommunity(String communityid)
        {
            if (CommunityIDSanctityCheck(communityid))
            {
                community = new CommunitiesModel();
                community.CommunityID = outCommunityID;

                return PartialView("Partials/Communities/EditCommunity", communitiesDAL.EditCommunity(community));
            }
            else
                return AjaxParamError("Community");
        }
        public ActionResult DeleteCommunity(String communityid)
        {
            if (CommunityIDSanctityCheck(communityid))
            {
                community = new CommunitiesModel();
                community.CommunityID = outCommunityID;;
                community.CommunityModifiedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString());
                community.CommunityModifiedRoleID = Convert.ToByte(useMyCookie["RoleID"].ToString());
                community.CommunityModifiedOn = Convert.ToDateTime(DateTime.Now.ToShortDateString());

                return Json(communitiesDAL.DeleteCommunity(community));
            }
            else
                return AjaxParamError("Community");
        }
        public ActionResult UpdateCommunity(CommunitiesModel editcommunity)
        {
            Int16 outUpdatedCommunity;
            if (this.ModelState.IsValid)
            {
                editcommunity.CommunityModifiedOn = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                editcommunity.CommunityModifiedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString());
                editcommunity.CommunityModifiedRoleID = Convert.ToByte(useMyCookie["RoleID"].ToString());

                if (Int16.TryParse(Convert.ToString(communitiesDAL.UpdateCommunity(editcommunity)), out outUpdatedCommunity))
                {
                    Session["UpdatedCommunityID"] = editcommunity.CommunityID;
                    return Json(Boolean.TrueString);
                }
                else
                    return Json(Boolean.FalseString);
            }
            else
            {
                return PartialView("Partials/Communities/EditCommunity", editcommunity);
            }
        }
        public ActionResult RolesList(String communityid)
        {
            if (CommunityIDSanctityCheck(communityid))
            {
                community = new CommunitiesModel();
                community.CommunityID = outCommunityID;;

                communityUsersByRole = new CommunityUsersByRole();
                communityUsersByRole.CommunityID = outCommunityID;;
                communityUsersByRoleList = new List<CommunityUsersByRole>();
                communityUsersByRoleList = accountDAL.GetCommunityUsersByRole(communityUsersByRole);
                if (communityUsersByRoleList != null)
                {
                    foreach (CommunityUsersByRole cubr in communityUsersByRoleList)
                    {
                        switch (cubr.RoleID)
                        {
                            case 2: ViewBag.AdministratorsCount = cubr.UsersCount;
                                break;
                            case 3: ViewBag.SecurityManagersCount = cubr.UsersCount;
                                break;
                            case 4: ViewBag.SercurityPersonsCount = cubr.UsersCount;
                                break;
                            case 5: ViewBag.HomeOwnersCount = cubr.UsersCount;
                                break;
                            case 6: ViewBag.ServiceProvidersCount = cubr.UsersCount;
                                break;
                        }
                    }
                }
                return PartialView("Partials/Users/RolesList");
            }
            return Json("Community");
        }
예제 #8
0
        internal void NewSecurityPersonnelCommunity(ref SecurityPersonnelsModel securitypersonnel)
        {
            CommunitiesModel community = new CommunitiesModel();
            CommunitiesModel communityDetails = new CommunitiesModel();

            community.CommunityID = securitypersonnel.CommunityID;
            CommunitiesDAL communitiesDAL = new CommunitiesDAL();
            communityDetails = communitiesDAL.CommunityDetails(community);

            securitypersonnel.CommunityName = communityDetails.CommunityName;
            securitypersonnel.CommunityAddress = communityDetails.CommunityAddress;
            securitypersonnel.City = communityDetails.City;
            securitypersonnel.Zip = communityDetails.Zip;
            securitypersonnel.State = communityDetails.State;
            securitypersonnel.Country = communityDetails.Country;
        }
        public ActionResult Users()
        {
            community = new CommunitiesModel();
            community.CommunityID = myCommunityID;

            communityUsersByRole = new CommunityUsersByRole();
            communityUsersByRole.CommunityID = myCommunityID;
            communityUsersByRoleList = new List<CommunityUsersByRole>();
            communityUsersByRoleList = accountDAL.GetCommunityUsersByRole(communityUsersByRole);
            if (communityUsersByRoleList != null)
            {
                foreach (CommunityUsersByRole cubr in communityUsersByRoleList)
                {
                    switch (cubr.RoleID)
                    {
                        case 2: ViewBag.AdministratorsCount = cubr.UsersCount;
                            break;
                        case 3: ViewBag.SecurityManagersCount = cubr.UsersCount;
                            break;
                        case 4: ViewBag.SercurityPersonsCount = cubr.UsersCount;
                            break;
                        case 5: ViewBag.HomeOwnersCount = cubr.UsersCount;
                            break;
                        case 6: ViewBag.ServiceProvidersCount = cubr.UsersCount;
                            break;
                    }
                }
            }
            return View("Users");
        }
예제 #10
0
 internal CommunitiesModel EditCommunity(CommunitiesModel community)
 {
     return CommunityDetails(community);
 }
예제 #11
0
 internal List<SelectListItem> GetCommunityHouseOwners(CommunitiesModel community)
 {
     AddParameter("@communityid", community.CommunityID);
     DataTable Dt_CommunityHouseOwnersList = GetDataTable("usp_GetHomeOwnersList");
     List<SelectListItem> communityHouseOwners = new List<SelectListItem>();
     if (Dt_CommunityHouseOwnersList.Rows.Count > 0)
     {
         foreach (DataRow dr in Dt_CommunityHouseOwnersList.Rows)
         {
             SelectListItem sli = new SelectListItem();
             sli.Text = dr["FirstName"].ToString() + "  " + dr["LastName"].ToString();
             sli.Value = dr["HomeOwnerID"].ToString();
             communityHouseOwners.Add(sli);
         }
     }
     return communityHouseOwners.ToList();
 }
예제 #12
0
        internal Object DeleteCommunity(CommunitiesModel community)
        {
            AddParameter("@communityid", community.CommunityID);

            AddParameter("@modifiedon", community.CommunityModifiedOn);
            AddParameter("@modifieduserid", community.CommunityModifiedUserID);
            AddParameter("@modifiedroleid", community.CommunityModifiedRoleID);

            return ExecuteScalar("usp_DeleteCommunity");
        }
예제 #13
0
        public void NewSecurityManagerCommunity(ref SecurityManagersModel securitymanager)
        {
            CommunitiesModel community = new CommunitiesModel();
            CommunitiesModel communityDetails = new CommunitiesModel();

            community.CommunityID = securitymanager.CommunityID;
            CommunitiesDAL communitiesDAL = new CommunitiesDAL();
            communityDetails = communitiesDAL.CommunityDetails(community);

            securitymanager.CommunityName = communityDetails.CommunityName;
            securitymanager.CommunityAddress = communityDetails.CommunityAddress;
            securitymanager.City = communityDetails.City;
            securitymanager.Zip = communityDetails.Zip;
            securitymanager.State = communityDetails.State;
            securitymanager.Country = communityDetails.Country;
        }
예제 #14
0
        internal void NewHomeOwnerCommunity(ref HomeOwnersModel homeowner)
        {
            CommunitiesModel community = new CommunitiesModel();
            CommunitiesModel communityDetails = new CommunitiesModel();

            community.CommunityID = homeowner.CommunityID;
            CommunitiesDAL communitiesDAL = new CommunitiesDAL();
            communityDetails = communitiesDAL.CommunityDetails(community);

            homeowner.CommunityName = communityDetails.CommunityName;
            homeowner.CommunityAddress = communityDetails.CommunityAddress;
            homeowner.City = communityDetails.City;
            homeowner.Zip = communityDetails.Zip;
            homeowner.State = communityDetails.State;
            homeowner.Country = communityDetails.Country;
        }
        public ActionResult NewCommunity(CommunitiesModel newcommunity)
        {
            Int16 outInsertedCommunity = 0;
            if (this.ModelState.IsValid)
            {
                newcommunity.CommunityCreatedOn = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                newcommunity.CommunityCreatedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString());
                newcommunity.CommunityCreatedRoleID = Convert.ToByte(useMyCookie["RoleID"].ToString());
                if (Int16.TryParse(communitiesDAL.AddCommunity(newcommunity).ToString(), out outInsertedCommunity))
                {
                    Session["NewCommunityID"] = outInsertedCommunity;
                    return Json(Boolean.TrueString);
                }
                else
                    return Json(Boolean.FalseString);

            }
            else
            {
                return PartialView("Partials/Communities/NewCommunity", newcommunity);
            }
        }
예제 #16
0
        internal CommunitiesModel CommunityDetails(CommunitiesModel community)
        {
            AddParameter("@communityid", community.CommunityID);
            DataTable Dt_CommunityDetails = GetDataTable("usp_GetCommunityDetails");
            CommunitiesModel communityDetails = new CommunitiesModel();

            if (Dt_CommunityDetails.Rows.Count > 0)
            {
                foreach (DataRow dr in Dt_CommunityDetails.Rows)
                {
                    communityDetails.CommunityID = Convert.ToInt16(dr["CommunityID"].ToString());
                    communityDetails.CommunityName = dr["CommunityName"].ToString();
                    communityDetails.CommunityAddress = dr["Address"].ToString();
                    communityDetails.City = dr["City"].ToString();
                    communityDetails.Zip = dr["Zip"].ToString();
                    communityDetails.State = dr["State"].ToString();
                    communityDetails.Country = dr["Country"].ToString();
                    communityDetails.CommunityPhone1 = dr["Phone1"].ToString();
                    communityDetails.CommunityPhone2 = dr["Phone2"].ToString();
                    communityDetails.CommunityEmail = dr["Email"].ToString();
                    communityDetails.TotalUnits = Convert.ToInt16(dr["TotalUnits"].ToString());
                    communityDetails.MaxGates = Convert.ToByte(dr["MaxGates"].ToString());
                    communityDetails.MenuOptions = dr["MenuOptions"].ToString();

                    communityDetails.CommunityCreatedOn = Convert.ToDateTime(dr["CreatedOn"].ToString());
                    communityDetails.CommunityCreatedUserID = Convert.ToInt64(dr["CreatedUserID"].ToString());
                    communityDetails.CommunityCreatedRoleID = Convert.ToByte(dr["CreatedRoleID"].ToString());

                    if (!String.IsNullOrEmpty(dr["ModifiedOn"].ToString()))
                    {
                        communityDetails.CommunityModifiedOn = Convert.ToDateTime(dr["ModifiedOn"].ToString());
                        communityDetails.CommunityModifiedUserID = Convert.ToInt64(dr["ModifiedUserID"].ToString());
                        communityDetails.CommunityModifiedRoleID = Convert.ToByte(dr["ModifiedUserID"].ToString());
                    }
                    communityDetails.CommunityStatus = Convert.ToChar(dr["Status"].ToString());
                }
            }
            return communityDetails;
        }
예제 #17
0
        public void NewAdministratorCommunity(ref AdministratorsModel newadministrator)
        {
            CommunitiesModel community = new CommunitiesModel();
            CommunitiesModel communityDetails = new CommunitiesModel();

            community.CommunityID = newadministrator.CommunityID;
            CommunitiesDAL communitiesDAL = new CommunitiesDAL();
            communityDetails = communitiesDAL.CommunityDetails(community);

            newadministrator.CommunityName = communityDetails.CommunityName;
            newadministrator.CommunityAddress = communityDetails.CommunityAddress;
            newadministrator.City = communityDetails.City;
            newadministrator.Zip = communityDetails.Zip;
            newadministrator.State = communityDetails.State;
            newadministrator.Country = communityDetails.Country;
        }
 public ActionResult NewVisitor(String communityid)
 {
     if (CommunityIDSanctityCheck(communityid))
     {
         community = new CommunitiesModel();
         community.CommunityID = outCommunityID;
         return PartialView("Partials/Visitors/NewVisitor", community);
     }
     else
         return AjaxParamError("Community");
 }
 public JsonResult CommunityHouseOwners()
 {
     if (Request.IsAjaxRequest())
     {
         community = new CommunitiesModel();
         community.CommunityID = myCommunityID;
         var vHouseOwners = communitiesDAL.GetCommunityHouseOwners(community);
         //Thread.Sleep(500);
         JsonResult result = new JsonResult();
         result.Data = vHouseOwners.ToList();
         result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
         return result;
     }
     else
         return null;
 }
예제 #20
0
        internal void NewServiceProviderCommunity(ref ServiceProvidersModel serviceprovider)
        {
            CommunitiesModel community = new CommunitiesModel();
            CommunitiesModel communityDetails = new CommunitiesModel();

            community.CommunityID = serviceprovider.CommunityID;
            CommunitiesDAL communitiesDAL = new CommunitiesDAL();
            communityDetails = communitiesDAL.CommunityDetails(community);

            serviceprovider.CommunityName = communityDetails.CommunityName;
            serviceprovider.CommunityAddress = communityDetails.CommunityAddress;
            serviceprovider.City = communityDetails.City;
            serviceprovider.Zip = communityDetails.Zip;
            serviceprovider.State = communityDetails.State;
            serviceprovider.Country = communityDetails.Country;
        }