Esempio n. 1
0
        public long?GetProfileRendition(IConnectToDB _Connect, long?identity_id)
        {
            long?value = 0;

            ER_DML er_dml = new ER_DML();

            _DynamicOutputProcedures DynamicOutput = new _DynamicOutputProcedures();

            List <DynamicModels.RootReportFilter> Filters = new List <DynamicModels.RootReportFilter>();

            Filters.Add(new DynamicModels.RootReportFilter {
                FilterName = "IDENTITIES_ID_", DBType = SqlDbType.BigInt, ParamValue = identity_id
            });

            DataTable TempDataTable = DynamicOutput.DynoProcSearch(_Connect, "Custom Query", "SP_S_VW_PROFILES_DAT_CHAR_RENDITION_SEARCH",
                                                                   new DataTableDotNetModelMetaData {
                length = -1, order = "1 asc", start = 0, verify = "T"
            },
                                                                   Filters);

            foreach (DataRow row in TempDataTable.Rows)
            {
                if (row["rendition"].ToString() != "")
                {
                    value = ER_Tools.ConvertToInt64(row["rendition"].ToString());
                }
            }

            return(value);
        }
Esempio n. 2
0
        public long?AddProfileEntry(IConnectToDB _Connect, long?identitiesId)
        {
            SecurityHelper securityHelper = new SecurityHelper();
            add            addHelp        = new add();
            long?          profilesId     = null;
            long?          privilegesId   = ER_Tools.ConvertToInt64(securityHelper.GetPrivID(_Connect, "ADD PROFILE"));

            //Enter profile information
            Values.AddProfiles ProfilesModel = null;
            ProfilesModel = addHelp.ADD_ENTRY_Profiles(_Connect, new Values.AddProfiles
            {
                I_IDENTITIES_ID = identitiesId,
                I_ENABLED       = 'Y',
            });
            profilesId = ProfilesModel.O_PROFILES_ID;

            //Enter profile security information
            //Values.AddProfilesSecPriv ProfilesSecPrivModel = null;
            //ProfilesSecPrivModel = addHelp.ADD_ENTRY_Profiles_Sec_Priv(_Connect, new Values.AddProfilesSecPriv
            //{
            //    I_OBJECT_TYPE = "Permission",
            //    I_PROFILES_ID = profilesId,
            //    I_PRIVILEGES_ID = privilegesId,
            //    I_ENABLED = 'Y',
            //    I_IDENTITIES_ID = identitiesId
            //});
            //profilesSecPrivId = ProfilesSecPrivModel.O_PROFILES_SEC_PRIV_ID;

            return(profilesId);
        }
Esempio n. 3
0
        public string UpdateProfileEntry(IConnectToDB _Connect, SessionObjects SO, FormCollection _formCollection)
        {
            SecurityHelper securityHelper = new SecurityHelper();
            IdentityHelper identityHelper = new IdentityHelper();
            ProfileHelper  profileHelper  = new ProfileHelper();
            add            addHelp        = new add();

            if (_formCollection.Keys.Count > 1)
            {
                long?  identitiesId      = ER_Tools.ConvertToInt64(identityHelper.GetIdentityID(_Connect, _formCollection["identitiesUUID"].ToString()));
                long?  identitiesIdOwner = SO.SessionIdentity.Identity.identities_id;
                long?  profilesId        = ER_Tools.ConvertToInt64(profileHelper.GetProfileId(_Connect, _formCollection["profilesUUID"].ToString()));
                string newemail          = _formCollection["email"].ToString();

                //Update profile information
                UpdateProfileEmail(_Connect, identitiesId, newemail);

                Values.UpdateProfiles ProfilesModel = null;
                ProfilesModel = addHelp.Update_ENTRY_Profiles(_Connect, new Values.UpdateProfiles
                {
                    I_PROFILES_ID    = profilesId,
                    I_IDENTITIES__ID = identitiesIdOwner,
                    I_FIRST_NAME     = _formCollection["firstName"].ToString(),
                    I_MIDDLE_NAME    = _formCollection["middleName"].ToString(),
                    I_LAST_NAME      = _formCollection["lastName"].ToString(),
                    I_OCCUPATION     = _formCollection["occupation"].ToString(),
                    I_STATE          = _formCollection["state"].ToString(),
                    I_ZIPCODE        = _formCollection["zipCode"].ToString(),
                    I_PHONE          = _formCollection["phone"].ToString(),
                    I_COUNTRY        = _formCollection["country"].ToString(),
                    I_CITY           = _formCollection["city"].ToString(),
                    I_ABOUT          = _formCollection["about"].ToString(),
                });
            }
            return("");
        }
Esempio n. 4
0
        public SessionObjects AddProfilePic(IConnectToDB _Connect, SessionObjects SO, FormCollection _formCollection)
        {
            try
            {
                if (_formCollection.Keys.Count > 1)
                {
                    SecurityHelper       securityHelper  = new SecurityHelper();
                    IdentityHelper       identityHelper  = new IdentityHelper();
                    ER_DML               er_dml          = new ER_DML();
                    add                  addHelp         = new add();
                    long?                identitiesId    = ER_Tools.ConvertToInt64(identityHelper.GetIdentityID(_Connect, _formCollection["identitiesUUID"].ToString()));
                    string               fileName        = _formCollection["fileName"].ToString();
                    string               fileType        = _formCollection["fileType"].ToString();
                    long?                fileSize        = ER_Tools.ConvertToInt64(_formCollection["fileSize"].ToString());
                    byte[]               fileContent     = Encoding.UTF8.GetBytes(_formCollection["profileImage"].ToString());
                    Guid?                ProfilesUUID    = ER_Tools.ConvertToGuid(_formCollection["profilesUUID"].ToString());
                    long?                Profiles_ID     = GetProfileId(_Connect, ProfilesUUID.ToString());
                    long?                profileImagesId = 0;
                    var                  profileImagesDT = GetImageIdByProfile(_Connect, Profiles_ID);
                    DataColumnCollection _dccColumnID    = profileImagesDT.Columns;

                    if (_dccColumnID.Contains("PROFILE_IMAGES_ID") && profileImagesDT.Rows.Count > 0)
                    {
                        Values.UpdateProfileImages ProfileImagesModel = null;
                        ProfileImagesModel = addHelp.UPDATE_ENTRY_Profile_Images(_Connect, new Values.UpdateProfileImages
                        {
                            I_PROFILE_IMAGES_ID = profileImagesDT.Rows[0].Field <long?>("PROFILE_IMAGES_ID"),
                            I_PROFILES_ID       = Profiles_ID,
                            I_FILE_NAME         = fileName,
                            I_FILE_SIZE         = fileSize,
                            I_CONTENT_TYPE      = fileType,
                            I_VALUE             = fileContent
                        });

                        profileImagesId = ProfileImagesModel.O_PROFILE_IMAGES_ID;

                        //Enable Profile Image
                        er_dml.TOGGLE_OBJECT(_Connect, "PROFILE_IMAGES", profileImagesId, "Y");
                    }
                    else
                    {
                        //Values.AddProfilesSecPriv ProfilesSecPrivModel = null;
                        //ProfilesSecPrivModel = addHelp.ADD_ENTRY_Profiles_Sec_Priv(_Connect, new Values.AddProfilesSecPriv
                        //{
                        //    I_OBJECT_TYPE = "Permission",
                        //    I_PROFILES_ID = Profiles_ID,
                        //    I_PRIVILEGES_ID = ER_Tools.ConvertToInt64(securityHelper.GetPrivID(_Connect, "CREATE OBJECT")),
                        //    I_ENABLED = 'Y',
                        //    I_IDENTITIES_ID = identitiesId
                        //});

                        Values.AddProfileImages ProfileImagesModel = null;
                        ProfileImagesModel = addHelp.ADD_ENTRY_Profile_Images(_Connect, new Values.AddProfileImages
                        {
                            I_IDENTITIES_ID = identitiesId,
                            I_PROFILES_UUID = ProfilesUUID,
                            I_ENABLED       = 'Y',
                            I_FILE_NAME     = fileName,
                            I_FILE_SIZE     = fileSize,
                            I_CONTENT_TYPE  = fileType,
                            I_VALUE         = fileContent
                        });
                    }

                    //Set Profile Image
                    _session.SetString("ProfileImage", GetProfileImage(_Connect, identitiesId));
                }
            }
            catch
            {
            }

            return(SO);
        }