public ActionResult NewServiceProvider(ServiceProvidersModel serviceProvider)
 {
     if (this.ModelState.IsValid)
     {
         serviceProvider.SRP_CreatedOn = Convert.ToDateTime(DateTime.Now.ToString());
         serviceProvider.SRP_CreatedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString());
         serviceProvider.SRP_CreatedRoleID = Convert.ToByte(useMyCookie["RoleID"].ToString());
         serviceProvidersDAL.AddServiceProvider(serviceProvider);
         return null;
     }
     else
         return View(serviceProvider);
 }
        public ActionResult RegistrationPartial(String roleid)
        {
            if (RoleIDSanctityCheck(roleid))
            {
                String partial = null;
                ViewBag.CommunityID = myCommunityID;
                Object loadModel = null;
                switch (roleid)
                {
                    case "2": partial = "Administrators/NewAdministrator";
                        administrator = new AdministratorsModel();
                        administrator.CommunityID = myCommunityID;
                        loadModel = administrator;
                        break;
                    case "3": partial = "SecurityManagers/NewSecurityManager";
                        securityManager = new SecurityManagersModel();
                        securityManager.CommunityID = myCommunityID;
                        loadModel = securityManager;
                        break;
                    case "4": partial = "SecurityPersonnels/NewSecurityPerson";
                        securityPersonnel = new SecurityPersonnelsModel();
                        securityPersonnel.CommunityID = myCommunityID;
                        loadModel = securityPersonnel;
                        break;
                    case "5": partial = "HomeOwners/NewHomeOwner";
                        homeOwner = new HomeOwnersModel();
                        homeOwner.CommunityID = myCommunityID;
                        loadModel = homeOwner;
                        break;
                    case "6": partial = "ServiceProviders/NewServiceProvider";
                        serviceProvider = new ServiceProvidersModel();
                        serviceProvider.CommunityID = myCommunityID;
                        loadModel = serviceProvider;
                        break;
                }

                return PartialView("Partials/Users/" + partial, loadModel);
            }
            else
                return AjaxParamError("Role");
        }
        public ActionResult DeleteServiceProvider(String serviceproviderid)
        {
            if (ServiceProviderIDSanctityCheck(serviceproviderid))
            {
                serviceProvider = new ServiceProvidersModel();
                serviceProvider.CommunityID = myCommunityID;
                serviceProvider.ServiceProviderID = Convert.ToInt64(serviceproviderid);
                serviceProvider.SRP_ModifiedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString());
                serviceProvider.SRP_ModifiedOn = Convert.ToDateTime(DateTime.Now.ToShortDateString());

                return Json(serviceProvidersDAL.DeleteServiceProvider(serviceProvider));
            }
            else
                return AjaxParamError("ServiceProvider");
        }
        public ActionResult EditServiceProvider(String serviceproviderid)
        {
            if (ServiceProviderIDSanctityCheck(serviceproviderid))
            {
                serviceProvider = new ServiceProvidersModel();
                serviceProvider.CommunityID = myCommunityID;
                serviceProvider.ServiceProviderID = outServiceProviderID;

                return PartialView("Partials/Users/ServiceProviders/EditServiceProvider", serviceProvidersDAL.EditServiceProvider(serviceProvider));
            }
            else
                return AjaxParamError("ServiceProvider");
        }
 public ActionResult UpdateServiceProvider(ServiceProvidersModel serviceProvider)
 {
     if (ModelState.IsValid)
     {
         serviceProvider.SRP_ModifiedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString());
         serviceProvider.SRP_ModifiedOn = Convert.ToDateTime(DateTime.Now.ToShortDateString());
         return Json(serviceProvidersDAL.UpdateServiceProvider(serviceProvider));
     }
     else
         return AjaxDataError("ServiceProvider");
 }
 private void ServiceProvidersList()
 {
     serviceProvider = new ServiceProvidersModel();
     serviceProvider.CommunityID = myCommunityID;
     ViewBag.ServiceProvidersList = serviceProvidersDAL.ServiceProvidersList(serviceProvider);
 }
 private void NewServiceProvider(ref ServiceProvidersModel newserviceprovider)
 {
     serviceProvidersDAL.NewServiceProviderCommunity(ref newserviceprovider);
 }
        public ActionResult ServiceProvidersListTable()
        {
            serviceProvider = new ServiceProvidersModel();
            serviceProvider.CommunityID = myCommunityID;
            ViewBag.ServiceProvidersList = serviceProvidersDAL.ServiceProvidersList(serviceProvider);

            return PartialView("Partials/Users/ServiceProviders/ServiceProvidersListTable");
        }
 public ActionResult ServiceProviderDetails(String serviceproviderid, String communityid)
 {
     if (CommunityIDSanctityCheck(communityid))
     {
         if (ServiceProviderIDSanctityCheck(serviceproviderid))
         {
             serviceProvider = new ServiceProvidersModel();
             serviceProvider.CommunityID = outCommunityID;
             serviceProvider.ServiceProviderID = outServiceProviderID;
             return PartialView("Partials/Users/ServiceProviders/ServiceProviderDetails", serviceProvidersDAL.ServiceProviderDetails(serviceProvider));
         }
         else
             return AjaxParamError("ServiceProvider");
     }
     else
         return AjaxParamError("Community");
 }
 public ActionResult ServiceProvidersListTable(String communityid)
 {
     if (CommunityIDSanctityCheck(communityid))
     {
         serviceProvider = new ServiceProvidersModel();
         serviceProvider.CommunityID = outCommunityID;
         return PartialView("Partials/Users/ServiceProviders/ServiceProvidersListTable", serviceProvidersDAL.ServiceProvidersList(serviceProvider));
     }
     else
         return AjaxParamError("Community");
 }
示例#11
0
        internal object AddServiceProvider(ServiceProvidersModel serviceprovider)
        {
            AddParameter("@communityid", serviceprovider.CommunityID);

            AddParameter("@email", serviceprovider.EmailID);
            AddParameter("@password", serviceprovider.Password);
            AddParameter("@hintquestionid", serviceprovider.SRP_HintQuestionID);
            AddParameter("@hint", serviceprovider.SRP_Hint);

            AddParameter("@name", serviceprovider.SRP_Name);
            AddParameter("@servicetypes", serviceprovider.SRP_ServiceTypes);
            AddParameter("@contactperson", serviceprovider.SRP_ContactPerson);
            AddParameter("@address", serviceprovider.SRP_Address);
            AddParameter("@phone1", serviceprovider.SRP_Phone1);
            AddParameter("@phone2", serviceprovider.SRP_Phone2);
            AddParameter("@rating", serviceprovider.SRP_Rating);
            AddParameter("@referredby", serviceprovider.SRP_ReferredBy);
            AddParameter("@specialization", serviceprovider.SRP_Specialization);

            AddParameter("@createdon", serviceprovider.SRP_CreatedOn);
            AddParameter("@createduserid", serviceprovider.SRP_CreatedUserID);
            AddParameter("@createdroleid", serviceprovider.SRP_CreatedRoleID);

            return this.ExecuteScalar("usp_AddServiceProvider");
        }
示例#12
0
        public List<ServiceProvidersModel> ServiceProvidersList(ServiceProvidersModel serviceprovider)
        {
            AddParameter("@communityid", serviceprovider.CommunityID);
            DataTable Dt_ServiceProvidersList = GetDataTable("usp_GetServiceProvidersList");
            serviceProvidersList = new List<ServiceProvidersModel>();

            if (Dt_ServiceProvidersList.Rows.Count > 0)
            {
                foreach (DataRow dr in Dt_ServiceProvidersList.Rows)
                {
                    serviceProviderObj = new ServiceProvidersModel();

                    serviceProviderObj.ServiceProviderID = Convert.ToInt64(dr["ServiceProviderID"].ToString());

                    serviceProviderObj.EmailID = dr["UserName"].ToString();
                    serviceProviderObj.SRP_HintQuestionID = Convert.ToByte(dr["HintQuestionID"].ToString());
                    serviceProviderObj.SRP_HintQuestion = dr["HintQuestion"].ToString();
                    serviceProviderObj.SRP_Hint = dr["Hint"].ToString();
                    serviceProviderObj.VFCode = dr["VFCode"].ToString();
                    serviceProviderObj.UserStatus = Convert.ToChar(dr["Status"]);
                    serviceProviderObj.UserID = Convert.ToInt64(dr["UserID"].ToString());
                    serviceProviderObj.Password = dr["Password"].ToString();
                    serviceProviderObj.RoleID = Convert.ToByte(dr["RoleID"].ToString());
                    serviceProviderObj.Role = dr["Role"].ToString();

                    serviceProviderObj.CommunityID = Convert.ToInt16(dr["CommunityID"].ToString());
                    serviceProviderObj.CommunityName = dr["CommunityName"].ToString();
                    serviceProviderObj.CommunityAddress = dr["CommunityAddress"].ToString();
                    serviceProviderObj.City = dr["City"].ToString();
                    serviceProviderObj.Zip = dr["Zip"].ToString();
                    serviceProviderObj.State = dr["State"].ToString();
                    serviceProviderObj.Country = dr["Country"].ToString();
                    serviceProviderObj.CommunityPhone1 = dr["CommunityPhone1"].ToString();
                    serviceProviderObj.CommunityPhone2 = dr["CommunityPhone2"].ToString();
                    serviceProviderObj.CommunityEmail = dr["CommunityEmail"].ToString();
                    serviceProviderObj.TotalUnits = Convert.ToByte(dr["TotalUnits"].ToString());
                    serviceProviderObj.MaxGates = Convert.ToByte(dr["MaxGates"].ToString());
                    serviceProviderObj.MenuOptions = dr["MenuOptions"].ToString();

                    serviceProviderObj.SRP_Name =  dr["Name"].ToString();
                    serviceProviderObj.SRP_ServiceTypes=  dr["ServiceTypes"].ToString();
                    serviceProviderObj.SRP_ContactPerson =  dr["ContactPerson"].ToString();
                    serviceProviderObj.SRP_Phone1 = dr["Phone1"].ToString();
                    serviceProviderObj.SRP_Phone2 =  dr["Phone2"].ToString();
                    serviceProviderObj.SRP_Address= dr["Address"].ToString();
                    serviceProviderObj.SRP_Rating = dr["Rating"].ToString();
                    serviceProviderObj.SRP_Specialization = dr["Specialization"].ToString();
                    serviceProviderObj.SRP_ReferredBy = dr["ReferredBy"].ToString();

                    serviceProviderObj.SRP_CreatedOn = Convert.ToDateTime(dr["CreatedOn"].ToString());
                    serviceProviderObj.SRP_CreatedUserID = Convert.ToInt64(dr["CreatedUserID"].ToString());
                    serviceProviderObj.SRP_CreatedRoleID = Convert.ToByte(dr["CreatedRoleID"].ToString());

                    if (!String.IsNullOrEmpty(dr["ModifiedOn"].ToString()))
                    {
                        serviceProviderObj.SRP_ModifiedOn = Convert.ToDateTime(dr["ModifiedOn"].ToString());
                        serviceProviderObj.SRP_ModifiedUserID = Convert.ToInt64(dr["ModifiedUserID"].ToString());
                        serviceProviderObj.SRP_ModifiedRoleID = Convert.ToByte(dr["ModifiedRoleID"].ToString());
                    }

                    serviceProvidersList.Add(serviceProviderObj);
                }
            }
            return serviceProvidersList;
        }
示例#13
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;
        }
示例#14
0
 internal ServiceProvidersModel EditServiceProvider(ServiceProvidersModel serviceprovider)
 {
     return this.ServiceProviderDetails(serviceprovider);
 }
示例#15
0
        internal Object DeleteServiceProvider(ServiceProvidersModel serviceprovider)
        {
            AddParameter("@serviceproviderid", serviceprovider.ServiceProviderID);
            AddParameter("@communityid", serviceprovider.CommunityID);

            AddParameter("@modifiedon", serviceprovider.SRP_ModifiedOn);
            AddParameter("@modifieduserid", serviceprovider.SRP_ModifiedUserID);
            AddParameter("@modifiedroleid", serviceprovider.SRP_ModifiedRoleID);

            return ExecuteScalar("usp_DeleteServiceProvider");
        }