private ReferrerModel FillReferrer(DataRow row)
        {
            ReferrerModel model = new ReferrerModel();

            model.Id          = (Int64)row["Id"];
            model.ReferrerUrl = (string)row["ReferrerUrl"];

            return(model);
        }
        public void SaveReferrer(ReferrerModel referrerModel)
        {
            Dictionary <string, DataAccessType> customerDictionary = new Dictionary <string, DataAccessType>();

            customerDictionary.Add("Id", new DataAccessType(referrerModel.Id.ToString(), typeof(string)));
            customerDictionary.Add("ReferrerUrl", new DataAccessType(referrerModel.ReferrerUrl, typeof(string)));

            DataAccess.Save(new ReferrerModel().DataProvider, new ReferrerModel().KeyField, "Referrers", customerDictionary);
        }
示例#3
0
        private void ReferrerItemDelete(RepeaterCommandEventArgs e)
        {
            ReferrerController controller = new ReferrerController();

            Label referrerIdLabel = (Label)e.Item.FindControl("ReferrerIdLabel");

            ReferrerModel referrer = new ReferrerModel();

            referrer.Id = System.Convert.ToInt64(referrerIdLabel.Text);

            controller.DeleteReferrer(referrer);
        }
示例#4
0
        private void ReferrerItemAdd(Repeater repeater, RepeaterCommandEventArgs e)
        {
            ReferrerController controller = new ReferrerController();

            TextBox referrerUrlTextBox = (TextBox)e.Item.FindControl("AddReferrerUrlTextBox");

            ReferrerModel referrer = new ReferrerModel();

            referrer.ReferrerUrl = referrerUrlTextBox.Text;

            controller.SaveReferrer(referrer);
        }
示例#5
0
        private void ReferrerItemSave(RepeaterCommandEventArgs e)
        {
            ReferrerController controller = new ReferrerController();

            Label   id = (Label)e.Item.FindControl("ReferrerIdLabel");
            TextBox referrerUrlTextBox = (TextBox)e.Item.FindControl("ReferrerUrlTextBox");

            ReferrerModel referrer = new ReferrerModel();

            if (id.Text != "")
            {
                referrer.Id = System.Convert.ToInt64(id.Text);
            }

            referrer.ReferrerUrl = referrerUrlTextBox.Text;

            controller.SaveReferrer(referrer);
        }
 public void DeleteReferrer(ReferrerModel referrerModel)
 {
     DataAccess.Delete(new ReferrerModel().DataProvider, "Referrers", new KeyValuePair <string, string>("Id", referrerModel.Id.ToString()));
 }
示例#7
0
        private void MergeNewValuesWithOriginal(ReferrerModel modelFromView)
        {
            //***************************The values that are display only will not be posted back so need to get them from session**************************

            ReferrerModel OriginalValuesFromSession = sessionManager.CurrentReferrer;
        }