public bool generateAccCls(string userName, string mode)
        {
            bool status = false;
            try
            {
                objUserPer = new UserPermission(ConnectionString);
                objUserPer.IsMList = RTAccountSettings.Nodes[0].Checked;
                objUserPer.IsList = RTAccountSettings.Nodes[0].Nodes[0].Checked;
                objUserPer.IsContact = RTAccountSettings.Nodes[0].Nodes[1].Checked;
                objUserPer.IsImport = RTAccountSettings.Nodes[0].Nodes[2].Checked;
                objUserPer.IsSegments = RTAccountSettings.Nodes[0].Nodes[3].Checked;
                objUserPer.IsDownloadContacts = RTAccountSettings.Nodes[0].Nodes[4].Checked;
                objUserPer.IsMCampaigns = RTAccountSettings.Nodes[1].Checked;
                objUserPer.IsMailing = RTAccountSettings.Nodes[1].Nodes[0].Checked;
                objUserPer.IsCampaigns = RTAccountSettings.Nodes[1].Nodes[1].Checked;
                objUserPer.IsTemplates = RTAccountSettings.Nodes[1].Nodes[2].Checked;
                objUserPer.IsAgedCampaigns = RTAccountSettings.Nodes[1].Nodes[3].Checked;
                objUserPer.IsMAdvanced = RTAccountSettings.Nodes[2].Checked;
                objUserPer.IsMangeFields = RTAccountSettings.Nodes[2].Nodes[0].Checked;
                objUserPer.IsMergeLists = RTAccountSettings.Nodes[2].Nodes[1].Checked;
                objUserPer.IsSuppressAddress = RTAccountSettings.Nodes[2].Nodes[2].Checked;
                objUserPer.IsBounceSettings = RTAccountSettings.Nodes[2].Nodes[3].Checked;
                objUserPer.IsMActivity = RTAccountSettings.Nodes[3].Checked;
                objUserPer.IsAccountActivity = RTAccountSettings.Nodes[3].Nodes[0].Checked;
                objUserPer.IsCompareCampaign = RTAccountSettings.Nodes[3].Nodes[1].Checked;
                objUserPer.IsBounceReport = RTAccountSettings.Nodes[3].Nodes[2].Checked;
                objUserPer.IsMCampReports = RTAccountSettings.Nodes[4].Checked;
                objUserPer.IsDashboard = RTAccountSettings.Nodes[4].Nodes[0].Checked;
                objUserPer.IsContactActivity = RTAccountSettings.Nodes[4].Nodes[1].Checked;
                objUserPer.IsClickPerformance = RTAccountSettings.Nodes[4].Nodes[2].Checked;
                objUserPer.IsAdvancedReports = RTAccountSettings.Nodes[4].Nodes[3].Checked;
                objUserPer.IsMicrositeManager = RTAccountSettings.Nodes[5].Checked;
                objUserPer.IsCustomizedAMMForms = RTAccountSettings.Nodes[6].Checked;
                objUserPer.IsAMMAdvanceReprot = RTAccountSettings.Nodes[7].Checked;
                objUserPer.MasterLogo = null;
                if (LogoFileUpload.HasFile)
                {
                    //Written By Swaroop Feb 15,2012 LogoFileUpload
                    System.IO.Stream streamContent = LogoFileUpload.PostedFile.InputStream;
                    picbyte = new byte[streamContent.Length];
                    MemoryStream ms = new MemoryStream(picbyte);
                    LogoFileUpload.PostedFile.InputStream.Read(picbyte, 0, picbyte.Length);
                    objUserPer.ChildLogo = picbyte;
                }
                else
                {
                    if (ViewState["Logo"] != null)
                        objUserPer.ChildLogo = (byte[])ViewState["Logo"];
                }
                objMembershipUser = Membership.GetUser(userName);
                objUserPer.UserName = userName;
                objUserPer.UserId = (Guid)objMembershipUser.ProviderUserKey;

                if (mode == "Insert")
                    status = objUserPer.Insert();
                else
                    status = objUserPer.Update();

                poplateTreeView(ddlUsers.SelectedItem.Text);

            }
            catch (Exception ex)
            {
                lblMsg.ForeColor = Color.Red;
                lblMsg.Text = ex.Message;
            }
            return status;
        }
Example #2
0
        /// <summary>
        /// Create User in UserPermissions Table
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public bool insertUserInPermissionsTb(string userName,object userId)
        {
            bool status = false;
            try
            {
                //First Get all Permissions of Client for User
                UserPermissions objClientPer = UserPermission.SelectByField("UserName",User.Identity.Name.ToString(), ConnectionString);

                //Add the Clent Permission to User For first Time
                UserPermission objUserPer = new UserPermission(ConnectionString);
                objUserPer.IsMList = (bool)objClientPer[0].IsMList;
                objUserPer.IsList = objClientPer[0].IsList;
                objUserPer.IsContact = objClientPer[0].IsContact;
                objUserPer.IsImport = objClientPer[0].IsImport;
                objUserPer.IsSegments = objClientPer[0].IsSegments;
                objUserPer.IsDownloadContacts = objClientPer[0].IsDownloadContacts;

                objUserPer.IsMCampaigns = objClientPer[0].IsMCampaigns;

                objUserPer.IsMailing =objClientPer[0].IsMailing;
                objUserPer.IsCampaigns = objClientPer[0].IsCampaigns;
                objUserPer.IsTemplates = objClientPer[0].IsTemplates;
                objUserPer.IsAgedCampaigns = objClientPer[0].IsAgedCampaigns;

                objUserPer.IsMAdvanced = objClientPer[0].IsMAdvanced;

                objUserPer.IsMangeFields = objClientPer[0].IsMangeFields;
                objUserPer.IsMergeLists =objClientPer[0].IsMergeLists;
                objUserPer.IsSuppressAddress = objClientPer[0].IsSuppressAddress;
                objUserPer.IsBounceSettings = false;

                objUserPer.IsMActivity =objClientPer[0].IsMActivity;

                objUserPer.IsAccountActivity =objClientPer[0].IsAccountActivity;
                objUserPer.IsCompareCampaign =objClientPer[0].IsCompareCampaign;
                objUserPer.IsBounceReport = objClientPer[0].IsBounceReport;

                objUserPer.IsMCampReports =objClientPer[0].IsMCampReports;

                objUserPer.IsDashboard =objClientPer[0].IsDashboard;
                objUserPer.IsContactActivity =objClientPer[0].IsContactActivity;
                objUserPer.IsClickPerformance =objClientPer[0].IsClickPerformance;
                objUserPer.IsAdvancedReports = objClientPer[0].IsAdvancedReports;

                objUserPer.IsMicrositeManager = objClientPer[0].IsMicrositeManager;
                objUserPer.IsCustomizedAMMForms = objClientPer[0].IsCustomizedAMMForms;
                objUserPer.IsAMMAdvanceReprot =objClientPer[0].IsAMMAdvanceReprot;

                objUserPer.ChildLogo = null;
                objUserPer.MasterLogo = null;

                objUserPer.UserId = (Guid)userId;
                objUserPer.UserName = userName;

                status = objUserPer.Insert();
            }
            catch (Exception ex)
            {

            }
            return status;
        }
Example #3
0
        public void createClientPermissions(string userName, string ConnectionString)
        {
            UserPermissions UserPermissions = UserPermission.SelectByField("UserName", userName, ConnectionString);
            if (UserPermissions.Count == 0)
            {
                UserPermission objUserPer = new UserPermission(ConnectionString);
                objUserPer.IsMList = true;
                objUserPer.IsList = true;
                objUserPer.IsContact = true;
                objUserPer.IsImport = true;
                objUserPer.IsSegments = true;
                objUserPer.IsDownloadContacts = true;

                objUserPer.IsMCampaigns = true;
                objUserPer.IsMailing = true;
                objUserPer.IsCampaigns = true;
                objUserPer.IsTemplates = true;
                objUserPer.IsAgedCampaigns = true;
                objUserPer.IsMAdvanced = true;
                objUserPer.IsMangeFields = true;
                objUserPer.IsMergeLists = true;
                objUserPer.IsSuppressAddress = true;
                objUserPer.IsBounceSettings = true;
                objUserPer.IsMActivity = true;
                objUserPer.IsAccountActivity = true;
                objUserPer.IsCompareCampaign = true;
                objUserPer.IsBounceReport = true;
                objUserPer.IsMCampReports = true;
                objUserPer.IsDashboard = true;
                objUserPer.IsContactActivity = true;
                objUserPer.IsClickPerformance = true;
                objUserPer.IsAdvancedReports = true;
                objUserPer.IsMicrositeManager = false;
                objUserPer.IsCustomizedAMMForms = false;
                objUserPer.IsAMMAdvanceReprot = false;
                objUserPer.MasterLogo = null;
                objUserPer.ChildLogo = null;
                objMembershipUser = Membership.GetUser(userName);
                objUserPer.UserName = userName;
                objUserPer.UserId = (Guid)objMembershipUser.ProviderUserKey;
                bool status = objUserPer.Insert();
            }
        }