protected void Page_Load(object sender, EventArgs e)
 {
     loggedInAdmin = Helpers.GetLoggedInAdmin();
     currentCompany = Helpers.GetCurrentCompany();
     CheckPermission();
     PopuplateBreadcrumbs();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();

            currentCompany = Helpers.GetCurrentCompany();

            currentAdGroup = Helpers.GetCurrentAdGroup();

            currentCampaign = currentAdGroup.campaign_;

            if (!Helpers.IsAuthorizedAdmin(loggedInAdmin, currentAdGroup.campaign_.company_))
            {
                Response.Redirect("/status.aspx?error=notadmin");
            }

            PopuplateBreadcrumbs();

            if (!IsPostBack)
            {
                UpdateAdGroupHyperLink.NavigateUrl = "/manage/AdGroups/UpdateAdGroupDetails.aspx?adgroup_id=" + currentAdGroup.adgroup_id;
                CreateAdMatchesHyperLink.NavigateUrl = "/manage/AdMatches/CreateAdMatches.aspx?adgroup_id=" + currentAdGroup.adgroup_id;
            }

            PopulateDetails();

            ShowAdMatches(currentAdGroup);
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            CurrentEmailLabel.Text = loggedInAdmin.email;

            PopuplateBreadcrumbs();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            current_adgroup = Helpers.GetCurrentAdGroup();

            if (!Helpers.IsAuthorizedAdmin(loggedInAdmin, current_adgroup.campaign_.company_))
            {
                Response.Redirect("/status.aspx?error=notadmin");
            }

            if (!IsPostBack)
            {
                ShowOwnStores();
            }
            PopuplateBreadcrumbs();

            //if (current_adgroup.campaign_.company_.is_retailer == false)
            //{
            //     ShowOwnButton.Enabled = false;
            //}

            //AdGroupBudgetLabel.Text = "$" + current_adgroup.budget;

            //PopulateExistingRequestedAds(current_adgroup);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();

            currentCompany = Helpers.GetCurrentCompany();

            currentCampaign = Helpers.GetCurrentCampaign();

            if (!Helpers.IsAuthorizedAdmin(loggedInAdmin, currentCompany))
            {
                Response.Redirect("/status.aspx?error=notadmin");
            }

            PopuplateBreadcrumbs();

            CancelHyperLink.NavigateUrl = "/manage/Campaigns/ManageCampaign.aspx?campaign_id=" + currentCampaign.campaign_id;

            if (!IsPostBack)
            {
                TitleTextBox.Text = currentCampaign.title;
                NotesTextBox.Text = currentCampaign.notes;

                StartDateTextBox.Text = currentCampaign.start_datetime.ToShortDateString();
                EndDateTextBox.Text = currentCampaign.end_datetime.ToShortDateString();
            }
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            currentCompany = Helpers.GetCurrentCompany();
            CompanyNameLiteral.Text = currentCompany.name;

            CheckPermission();

            PopuplateBreadcrumbs();
            PopulateDetails();
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();

            if (!Helpers.IsSuperUser(loggedInAdmin))
            {
                Response.Redirect("/status.aspx?error=notsuperuser");
            }

            PopulateCompanies();

            PopuplateBreadcrumbs();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();

            if (!IsPostBack)
            {
                FirstNameTextBox.Text = loggedInAdmin.first_name;
                LastNameTextBox.Text = loggedInAdmin.last_name;
                PhoneTextBox.Text = loggedInAdmin.phone;
                MobileTextBox.Text = loggedInAdmin.mobile;
            }

            PopuplateBreadcrumbs();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            currentCompany = Helpers.GetCurrentCompany();
            CheckPermission();

            if (!IsPostBack)
            {
                DateTime startDate = Helpers.ConvertServerDateTimetoLocal(DateTime.Now);
                DailyDateTextBox.Text = startDate.ToShortDateString();

                    PopulateStores();
            }
            PopuplateBreadcrumbs();
        }
Esempio n. 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            current_company = Helpers.GetCurrentCompany();

            if (!Helpers.IsAuthorizedOwner(loggedInAdmin, current_company))
            {
                Response.Redirect("/status.aspx?error=notowner");
            }

            if (!IsPostBack)
            {
                PopulateDetails();
            }
            PopuplateBreadcrumbs();
        }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            current_company = Helpers.GetCurrentCompany();

            if (!Helpers.IsAuthorizedAdmin(loggedInAdmin, current_company))
            {
                Response.Redirect("/status.aspx?error=notadmin");
            }

            if (!IsPostBack)
            {
                RefreshCampaignsGridView(current_company);
            }
            PopuplateBreadcrumbs();
        }
Esempio n. 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            currentCompany = Helpers.GetCurrentCompany();
            currentInvoice = Helpers.GetCurrentInvoice();
            CheckPermission();

            PopulateInvoice();

            if (Request.QueryString["print"] == "true")
            {
                PrintHyperLink.Visible = false;
            }
            else
            {
                PopuplateBreadcrumbs();
            }
        }
Esempio n. 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            currentCompany = Helpers.GetCurrentCompany();
            CheckPermission();

            currentDocket = Helpers.GetCurrentDocket();
            if (currentDocket.store_.company_id == currentCompany.company_id)
            {
                    DocketTextLiteral.Text =  Server.HtmlEncode(currentDocket.raw_content);
            }
            else
            {
                HttpContext.Current.Response.Redirect("/status.aspx?msg=generic");
            }

            PopuplateBreadcrumbs();
        }
Esempio n. 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            currentCompany = Helpers.GetCurrentCompany();
            currentStore = Helpers.GetCurrentStore();

            if (!Helpers.IsAuthorizedAdmin(loggedInAdmin, currentCompany))
            {
                Response.Redirect("/status.aspx?error=notadmin");
            }
            else if (!Helpers.IsStoreAccessible(currentStore, currentCompany))
            {
                Response.Redirect("/status.aspx?error=generic");
            }

            StoreLiteral.Text = currentStore.suburb;
            PopuplateBreadcrumbs();
            PopulateDetails();
        }
Esempio n. 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            currentCompany = Helpers.GetCurrentCompany();
            CheckPermission();

            PopuplateBreadcrumbs();

            if (!IsPostBack)
            {
                if (currentCompany.is_rewards == true)
                {
                    if (currentCompany.RewardSettingsBycompany_.Count != 0)
                    {
                        EnableRewardsPanel.Visible = false;
                        EnableRewardsPanel.Enabled = false;

                        ActiveModulePanel.Visible = true;
                        ActiveModulePanel.Enabled = true;
                    }
                }
            }
        }
Esempio n. 16
0
        /// <summary>
        /// Create a new Trigger object from a Admin object.
        /// </summary>
        /// <param name="creator_">creator_</param>
        /// <returns>The newly created Trigger object.</returns>
        public static Trigger CreateTriggerBycreator_(Admin @creator_)
        {
            Trigger trigger = InitializeNew<Trigger>();

            trigger.creator_id = @creator_.admin_id;

            trigger.creator_ = @creator_;

            return trigger;
        }
Esempio n. 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();

               if (!Helpers.IsSuperUser(loggedInAdmin))
               {
                    Response.Redirect("/status/errormessage.aspx?error=" + ErrorHelper.notsuperuser);
               }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            currentCompany = Helpers.GetCurrentCompany();
            currentList = Helpers.GetCurrentList();

            CheckPermission();
            PopuplateBreadcrumbs();
            EnableMailchimp();

            if (!IsPostBack)
            {
                PopulateCustomers();
            }
        }
        /// <summary>
        /// Create a new PointsLog object from a Admin object.
        /// </summary>
        /// <param name="admin_">admin_</param>
        /// <returns>The newly created PointsLog object.</returns>
        public static PointsLog CreatePointsLogByadmin_(Admin @admin_)
        {
            PointsLog pointsLog = InitializeNew<PointsLog>();

            pointsLog.admin_id = @admin_.admin_id;

            pointsLog.admin_ = @admin_;

            return pointsLog;
        }
        /// <summary>
        /// Gets a collection of OutgoingSMS objects by a Admin object.
        /// </summary>
        /// <param name="admin">admin</param>
        /// <param name="startRowIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRows"></param>
        /// <returns>A collection OutgoingSMS objects.</returns>
        public static EntityList<OutgoingSMS> GetOutgoingSMsByadmin_(Admin @admin_, long startRowIndex, int pageSize, out long totalRows)
        {
            string commandText = @"
            FROM
            [dbo].[OutgoingSMS]
            WHERE
            [OutgoingSMS].[admin_id] = @admin_id ";

            List<SqlParameter> parameters = new List<SqlParameter>();

            parameters.Add(new SqlParameter("@admin_id", @admin_.admin_id));

            return GetList<OutgoingSMS>(SelectFieldList, commandText, parameters, null, startRowIndex, pageSize, out totalRows);
        }
Esempio n. 21
0
        private void AddAdminToCompany(Admin new_admin, string company_position, string role)
        {
            Permission new_permission = Permission.CreatePermission();

            try
            {
                Role admin_role = Role.GetRole(role);
                new_permission.admin_id = new_admin.admin_id;
                new_permission.role_name = admin_role;
                new_permission.company_id = current_company.company_id;
                new_permission.company_position = company_position;

                new_permission.authoriser_id = loggedInAdmin.admin_id;

                new_permission.creation_datetime = DateTime.Now;

                new_permission.Save();

                AdminListErrorLabel.Text = "New administrator has been successfully added. An email has been sent informing them.";
            }
            catch (Exception ex)
            {
                AdminListErrorLabel.Text = ErrorHelper.generic;
            }
        }
Esempio n. 22
0
        /// <summary>
        /// Gets a collection of Trigger objects by a Admin object.
        /// </summary>
        /// <param name="admin">admin</param>
        /// <param name="startRowIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRows"></param>
        /// <returns>A collection Trigger objects.</returns>
        public static EntityList<Trigger> GetTriggersBycreator_(Admin @creator_, long startRowIndex, int pageSize, out long totalRows)
        {
            string commandText = @"
            FROM
            [dbo].[Triggers]
            WHERE
            [Triggers].[creator_id] = @creator_id ";

            List<SqlParameter> parameters = new List<SqlParameter>();

            parameters.Add(new SqlParameter("@creator_id", @creator_.admin_id));

            return GetList<Trigger>(SelectFieldList, commandText, parameters, null, startRowIndex, pageSize, out totalRows);
        }
        /// <summary>
        /// Gets a collection of PointsLog objects by a Admin object.
        /// </summary>
        /// <param name="admin_">admin_</param>
        /// <returns>A collection PointsLog objects.</returns>
        public static EntityList<PointsLog> GetPointsLogsByadmin_(Admin @admin_)
        {
            string commandText = "PointsLogGetByAdmin";

            List<SqlParameter> parameters = new List<SqlParameter>();
            parameters.Add(new SqlParameter("@admin_id", @admin_.admin_id));

            return GetList<PointsLog>(@admin_, commandText, parameters);
        }
Esempio n. 24
0
        /// <summary>
        /// Deletes Trigger objects by a Admin object.
        /// </summary>
        /// <param name="admin">admin</param>
        public static void DeleteTriggersBycreator_(Admin admin)
        {
            string commandText = "TriggerDeleteByAdmin";

            System.Collections.Generic.List<SqlParameter> parameters = new System.Collections.Generic.List<SqlParameter>();
            parameters.Add(new SqlParameter("@creator_id", admin.admin_id));

            using (SqlHelper helper = new SqlHelper())
            {
                helper.Execute(commandText, CommandType.StoredProcedure, parameters);
            }
        }
Esempio n. 25
0
        /// <summary>
        /// Gets a collection of Trigger objects by a Admin object.
        /// </summary>
        /// <param name="creator_">creator_</param>
        /// <returns>A collection Trigger objects.</returns>
        public static EntityList<Trigger> GetTriggersBycreator_(Admin @creator_)
        {
            string commandText = "TriggerGetByAdmin";

            List<SqlParameter> parameters = new List<SqlParameter>();
            parameters.Add(new SqlParameter("@creator_id", @creator_.admin_id));

            return GetList<Trigger>(@creator_, commandText, parameters);
        }
        /// <summary>
        /// Gets a collection of PointsLog objects by a Admin object.
        /// </summary>
        /// <param name="admin">admin</param>
        /// <param name="orderBy"></param>
        /// <param name="startRowIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRows"></param>
        /// <returns>A collection PointsLog objects.</returns>
        protected static EntityList<PointsLog> GetPointsLogsByadmin_(Admin @admin_, string orderBy, long startRowIndex, int pageSize, out long totalRows)
        {
            string commandText = @"
            FROM
            [dbo].[PointsLog]
            WHERE
            [PointsLog].[admin_id] = @admin_id ";

            List<SqlParameter> parameters = new List<SqlParameter>();

            parameters.Add(new SqlParameter("@admin_id", @admin_.admin_id));

            return GetList<PointsLog>(SelectFieldList, commandText, parameters, orderBy, startRowIndex, pageSize, out totalRows);
        }
        /// <summary>
        /// Create a new OutgoingSMS object from a Admin object.
        /// </summary>
        /// <param name="admin_">admin_</param>
        /// <returns>The newly created OutgoingSMS object.</returns>
        public static OutgoingSMS CreateOutgoingSMSByadmin_(Admin @admin_)
        {
            OutgoingSMS outgoingSMS = InitializeNew<OutgoingSMS>();

            outgoingSMS.admin_id = @admin_.admin_id;

            outgoingSMS.admin_ = @admin_;

            return outgoingSMS;
        }
        /// <summary>
        /// Gets a collection of OutgoingSMS objects by a Admin object.
        /// </summary>
        /// <param name="admin_">admin_</param>
        /// <returns>A collection OutgoingSMS objects.</returns>
        public static EntityList<OutgoingSMS> GetOutgoingSMsByadmin_(Admin @admin_)
        {
            string commandText = "OutgoingSMSGetByAdmin";

            List<SqlParameter> parameters = new List<SqlParameter>();
            parameters.Add(new SqlParameter("@admin_id", @admin_.admin_id));

            return GetList<OutgoingSMS>(@admin_, commandText, parameters);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     loggedInAdmin = Helpers.GetLoggedInAdmin();
     PopuplateBreadcrumbs();
 }
Esempio n. 30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AdminListErrorLabel.Text = "";

            loggedInAdmin = Helpers.GetLoggedInAdmin();

            current_company = Helpers.GetCurrentCompany();

            if (!Helpers.IsAuthorizedOwner(loggedInAdmin, current_company))
            {
                Response.Redirect("/status.aspx?msg=notauthorized");
            }

            if (!IsPostBack)
            {
                RefreshAdminsGridview();
            }

            PopuplateBreadcrumbs();
        }