public List<Config> Config_GetByTop(string Top, string Where, string Order) { List<Data.Config> list = new List<Data.Config>(); using (SqlCommand dbCmd = new SqlCommand("sp_Config_GetByTop", GetConnection())) { Data.Config obj = new Data.Config(); dbCmd.CommandType = CommandType.StoredProcedure; dbCmd.Parameters.Add(new SqlParameter("@Top", Top)); dbCmd.Parameters.Add(new SqlParameter("@Where", Where)); dbCmd.Parameters.Add(new SqlParameter("@Order", Order)); SqlDataReader dr = dbCmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { list.Add(obj.ConfigIDataReader(dr)); } dr.Close(); //conn.Close(); } else { dr.Close(); } } return list; }
protected void Update_Click(object sender, EventArgs e) { if (Page.IsValid) { Data.Config obj = new Data.Config(); obj.Id = Id; obj.Mail_Smtp = txtMail_Smtp.Text; obj.Mail_Info = txtMail_Info.Text; obj.Mail_Port = txtMail_Port.Text; obj.Mail_Password = txtMail_Password.Text; obj.Mail_Noreply = txtMail_Noreply.Text; obj.Contact = fckContent.Value; obj.Copyright = fckCopyright.Value; obj.Title = txtTitle.Text; obj.Keyword = txtDescription.Text; obj.Description = txtKeyword.Text; if (Insert == true) { ConfigService.Config_Insert(obj); } else { ConfigService.Config_Update(obj); } } }
public static IPushNotificationConfiguration GetPushNotificationConfig() { var svc = new Data.Config("PushNotificationConfiguration.json"); var c = svc.BuildConfigs(); var sc = c.GetSection("PushNotificationConfiguration").Get <PushNotificationConfiguration>(); return(sc); }
public static SmsConfiguration GetSmsConfig() { var svc = new Data.Config("SmsConfiguration.json"); var c = svc.BuildConfigs(); var sc = c.GetSection("SmsConfiguration").Get <SmsConfiguration>(); return(sc); }
protected void UpdateConfig(string key, string value) { Data.Config record = mDb.Configs.SingleOrDefault(r => r.Key == key); if (record == null) { mDb.Configs.InsertOnSubmit(new Data.Config() { Key = key, Value = value }); } else { record.Value = value; } }
public Config ConfigIDataReader(IDataReader dr) { Data.Config obj = new Data.Config(); obj.Id = (dr["Id"] is DBNull) ? string.Empty : dr["Id"].ToString(); obj.Mail_Smtp = (dr["Mail_Smtp"] is DBNull) ? string.Empty : dr["Mail_Smtp"].ToString(); obj.Mail_Port = (dr["Mail_Port"] is DBNull) ? string.Empty : dr["Mail_Port"].ToString(); obj.Mail_Info = (dr["Mail_Info"] is DBNull) ? string.Empty : dr["Mail_Info"].ToString(); obj.Mail_Noreply = (dr["Mail_Noreply"] is DBNull) ? string.Empty : dr["Mail_Noreply"].ToString(); obj.Mail_Password = (dr["Mail_Password"] is DBNull) ? string.Empty : dr["Mail_Password"].ToString(); obj.Contact = (dr["Contact"] is DBNull) ? string.Empty : dr["Contact"].ToString(); obj.Copyright = (dr["Copyright"] is DBNull) ? string.Empty : dr["Copyright"].ToString(); obj.Title = (dr["Title"] is DBNull) ? string.Empty : dr["Title"].ToString(); obj.Description = (dr["Description"] is DBNull) ? string.Empty : dr["Description"].ToString(); obj.Keyword = (dr["Keyword"] is DBNull) ? string.Empty : dr["Keyword"].ToString(); return(obj); }
public List<Config> Config_GetByAll() { List<Data.Config> list = new List<Data.Config>(); using (SqlCommand dbCmd = new SqlCommand("sp_Config_GetByAll", GetConnection())) { Data.Config obj = new Data.Config(); dbCmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = dbCmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { list.Add(obj.ConfigIDataReader(dr)); } dr.Close(); //conn.Close(); } else { dr.Close(); } } return list; }
public List<Config> Config_Paging(string CurentPage, string PageSize) { List<Data.Config> list = new List<Data.Config>(); using (SqlCommand dbCmd = new SqlCommand("sp_Config_Paging", GetConnection())) { Data.Config obj = new Data.Config(); dbCmd.CommandType = CommandType.StoredProcedure; dbCmd.Parameters.Add(new SqlParameter("@CurentPage", CurentPage)); dbCmd.Parameters.Add(new SqlParameter("@PageSize", PageSize)); SqlDataReader dr = dbCmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { list.Add(obj.ConfigIDataReader(dr)); } dr.Close(); //conn.Close(); } else { dr.Close(); } } return list; }
protected void Update_Click(object sender, EventArgs e) { if (Page.IsValid) { Data.Config obj = new Data.Config(); obj.Id = Id; obj.Mail_Smtp = txtMail_Smtp.Text; obj.Mail_Port = txtMail_Port.Text; obj.Mail_Info = txtMail_Info.Text; obj.Mail_Noreply = txtMail_Noreply.Text; obj.Mail_Password = txtMail_Password.Text; obj.PlaceHead = txtPlaceHead.Text; //obj.PlaceBody = txtPlaceBody.Text; obj.PlaceBody = fckPlaceBody.Value; obj.GoogleId = txtGoogleId.Text; obj.Contact = fckContact.Value; obj.DeliveryTerms = fckDeliveryTerms.Value; obj.PaymentTerms = fckPaymentTerms.Value; obj.FreeShipping = txtFreeShipping.Text; obj.Copyright = fckCopyright.Value; obj.Title = txtTitle.Text; obj.Description = txtDescription.Text; obj.Keyword = txtKeyword.Text; obj.Lang = Lang; obj.Helpsize = this.fckhelp_size.Value.ToString(); obj.Location = DDLLocation.SelectedValue.ToString(); if (Insert == true) { ConfigService.Config_Insert(obj); } else { ConfigService.Config_Update(obj); } //BindGrid(); //pnView.Visible = true; //pnUpdate.Visible = false; Insert = false; } }
protected void Update_Click(object sender, EventArgs e) { if (Page.IsValid) { Data.Config obj = new Data.Config(); obj.Id = Id; obj.SendGmail = "*****@*****.**"; obj.Password = "******"; obj.ReceiveGmail = "*****@*****.**"; obj.Banner = txtBanner.Text; obj.Footer = fckFooter.Value; obj.PageTitle = txtPageTitle.Text; obj.Description = txtDescription.Text; obj.MetaKeyword = txtMetaKeyword.Text; obj.ModifiedDate = DateTimeClass.ConvertDateTime(txtModifiedDate.Text, "MM/dd/yyyy HH:mm:ss"); obj.IsApply = chkIsApply.Checked ? "1" : "0"; if (Insert == true) { ConfigService.Config_Insert(obj); } else { ConfigService.Config_Update(obj); } BindGrid(); pnView.Visible = true; pnUpdate.Visible = false; Insert = false; } }
public Config ConfigIDataReader(IDataReader dr) { Data.Config obj = new Data.Config(); obj.Id = (dr["Id"] is DBNull) ? string.Empty : dr["Id"].ToString();
public Config() : base() { _config = new Fpp.WebModules.Data.Config(_moduleSettings); }