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); }
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); }
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); }
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())); }
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; }