コード例 #1
0
        //public ActionResult SecurityPersonnelDetails(String securitypersonnelid, String communityid)
        //{
        //    if (CommunityIDSanctityCheck(communityid))
        //    {
        //        if (SecurityPersonnelIDSanctityCheck(securitypersonnelid))
        //        {
        //            securityPersonnel = new SecurityPersonnelsModel();
        //            securityPersonnel.CommunityID = outCommunityID;
        //            securityPersonnel.SecurityPersonnelID = Convert.ToInt64(securitypersonnelid);
        //            return PartialView("Partials/Users/SecurityPersonnels/SecurityPersonnelDetails", securityPersonnelsDAL.SecurityPersonnelDetails(securityPersonnel));
        //        }
        //        else
        //            return AjaxParamError("SecurityPersonnel");
        //    }
        //    else
        //        return AjaxParamError("Community");
        //}
        public ActionResult EditSecurityPersonnel(String securitypersonnelid, String communityid)
        {
            if (CommunityIDSanctityCheck(communityid))
            {
                if (SecurityPersonnelIDSanctityCheck(securitypersonnelid))
                {
                    editSecurityPersonnel = new EditSecurityPersonnelModel();
                    editSecurityPersonnel.CommunityID = outCommunityID;
                    editSecurityPersonnel.SecurityPersonnelID = outSecurityPersonnelID;

                    return PartialView("Partials/Users/SecurityPersonnels/EditSecurityPersonnel", securityPersonnelsDAL.EditSecurityPersonnel(editSecurityPersonnel));
                }
                else
                    return AjaxParamError("SecurityPersonnel");
            }
            else
                return AjaxParamError("Community");
        }
コード例 #2
0
        internal Object UpdateSecurityPerson(EditSecurityPersonnelModel editsecuritypersonnel)
        {
            AddParameter("@securitypersonnelid", editsecuritypersonnel.SecurityPersonnelID);
            AddParameter("@communityid", editsecuritypersonnel.CommunityID);
            AddParameter("@password", editsecuritypersonnel.Password);
            AddParameter("@hintquestionid", editsecuritypersonnel.SP_HintQuestionID);
            AddParameter("@hint", editsecuritypersonnel.SP_Hint);

            AddParameter("@firstname", editsecuritypersonnel.SP_FirstName);
            AddParameter("@middlename", editsecuritypersonnel.SP_MiddleName);
            AddParameter("@lastname", editsecuritypersonnel.SP_LastName);
            AddParameter("@mobile", editsecuritypersonnel.SP_Mobile);
            AddParameter("@homephone", editsecuritypersonnel.SP_HomePhone);
            AddParameter("@workphone", editsecuritypersonnel.SP_WorkPhone);
            AddParameter("@address1", editsecuritypersonnel.SP_Address1);
            AddParameter("@address2", editsecuritypersonnel.SP_Address2);

            AddParameter("@modifieduserid", editsecuritypersonnel.SP_ModifiedUserID);
            AddParameter("@modifiedroleid", editsecuritypersonnel.SP_ModifiedRoleID);
            AddParameter("@modifiedon", editsecuritypersonnel.SP_ModifiedOn);

            return this.ExecuteScalar("usp_UpdateSecurityPersonnel");
        }
コード例 #3
0
 public ActionResult UpdateSecurityPersonnel(EditSecurityPersonnelModel editsecuritypersonnel)
 {
     if (this.ModelState.IsValid)
     {
         editsecuritypersonnel.CommunityID = outCommunityID;
         editsecuritypersonnel.SP_ModifiedOn = Convert.ToDateTime(DateTime.Now.ToShortDateString());
         editsecuritypersonnel.SP_ModifiedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString());
         editsecuritypersonnel.SP_ModifiedRoleID = Convert.ToByte(useMyCookie["RoleID"].ToString());
         return Json(securityPersonnelsDAL.UpdateSecurityPerson(editsecuritypersonnel));
     }
     else
         return AjaxDataError("SecurityPersonnel");
 }
コード例 #4
0
        internal EditSecurityPersonnelModel EditSecurityPersonnel(EditSecurityPersonnelModel editsecuritypersonnel)
        {
            AddParameter("@securitypersonnelid", editsecuritypersonnel.SecurityPersonnelID);
            AddParameter("@communityid", editsecuritypersonnel.CommunityID);

            DataTable Dt_SecurityPersonnelDetails = this.GetDataTable("usp_GetSecurityPersonnelDetails");

            if (Dt_SecurityPersonnelDetails.Rows.Count > 0)
            {
                foreach (DataRow dr in Dt_SecurityPersonnelDetails.Rows)
                {
                    editsecuritypersonnel = new EditSecurityPersonnelModel();

                    editsecuritypersonnel.SecurityPersonnelID = Convert.ToInt64(dr["SecurityPersonnelID"].ToString());

                    editsecuritypersonnel.CommunityID = Convert.ToInt16(dr["CommunityID"].ToString());

                    editsecuritypersonnel.EmailID = dr["UserName"].ToString();
                    editsecuritypersonnel.SP_HintQuestionID = Convert.ToByte(dr["HintQuestionID"].ToString());
                    editsecuritypersonnel.SP_HintQuestion = dr["HintQuestion"].ToString();
                    editsecuritypersonnel.SP_Hint = dr["Hint"].ToString();
                    editsecuritypersonnel.CurrentPassword = dr["Password"].ToString();

                    editsecuritypersonnel.SP_FirstName = dr["FirstName"].ToString();
                    editsecuritypersonnel.SP_MiddleName = dr["MiddleName"].ToString();
                    editsecuritypersonnel.SP_LastName = dr["LastName"].ToString();
                    editsecuritypersonnel.SP_Mobile = dr["Mobile"].ToString();
                    editsecuritypersonnel.SP_HomePhone = dr["HomePhone"].ToString();
                    editsecuritypersonnel.SP_WorkPhone = dr["WorkPhone"].ToString();
                    editsecuritypersonnel.SP_Address1 = dr["Address1"].ToString();
                    editsecuritypersonnel.SP_Address2 = dr["Address2"].ToString();

                    if (!String.IsNullOrEmpty(dr["ModifiedOn"].ToString()))
                    {
                        editsecuritypersonnel.SP_ModifiedOn = Convert.ToDateTime(dr["ModifiedOn"].ToString());
                        editsecuritypersonnel.SP_ModifiedUserID = Convert.ToInt64(dr["ModifiedUserID"].ToString());
                        editsecuritypersonnel.SP_ModifiedRoleID = Convert.ToByte(dr["ModifiedRoleID"].ToString());
                    }
                }
            }
            return editsecuritypersonnel;
        }