protected void Page_Load(object sender, EventArgs e)
 {
     loggedInAdmin = Helpers.GetLoggedInAdmin();
     currentCompany = Helpers.GetCurrentCompany();
     CheckPermission();
     PopuplateBreadcrumbs();
 }
Exemplo n.º 2
0
        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);
        }
Exemplo 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);
        }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            currentCompany = Helpers.GetCurrentCompany();
            CompanyNameLiteral.Text = currentCompany.name;

            CheckPermission();

            PopuplateBreadcrumbs();
            PopulateDetails();
        }
Exemplo 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();
        }
Exemplo n.º 8
0
        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();
        }
Exemplo n.º 9
0
        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();
        }
Exemplo 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();
        }
Exemplo 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();
        }
Exemplo 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();
            }
        }
Exemplo 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();
        }
Exemplo 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();
        }
Exemplo 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;
                    }
                }
            }
        }
Exemplo 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;
        }
Exemplo 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);
               }
        }
Exemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInAdmin = Helpers.GetLoggedInAdmin();
            currentCompany = Helpers.GetCurrentCompany();
            currentList = Helpers.GetCurrentList();

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

            if (!IsPostBack)
            {
                PopulateCustomers();
            }
        }
Exemplo n.º 19
0
        /// <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;
        }
Exemplo n.º 20
0
        /// <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);
        }
Exemplo 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;
            }
        }
Exemplo 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);
        }
Exemplo n.º 23
0
        /// <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);
        }
Exemplo 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);
            }
        }
Exemplo 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);
        }
Exemplo n.º 26
0
        /// <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);
        }
Exemplo n.º 27
0
        /// <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;
        }
Exemplo n.º 28
0
        /// <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);
        }
Exemplo n.º 29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     loggedInAdmin = Helpers.GetLoggedInAdmin();
     PopuplateBreadcrumbs();
 }
Exemplo 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();
        }