/// <summary> /// LoadQnDataSource /// </summary> void LoadQnDataSource() { List <EntityParm> dicParm = new List <EntityParm>(); string beginDate = DateTime.Now.AddDays(-7).ToString("yyyy.MM.dd"); string endDate = DateTime.Now.ToString("yyyy.MM.dd"); if (beginDate != string.Empty && endDate != string.Empty) { dicParm.Add(Function.GetParm("genDate", beginDate + "|" + endDate)); } using (ProxyHms proxy = new ProxyHms()) { lstClientInfo = proxy.Service.GetClientInfoAndRpt(dicParm); gcClient.DataSource = lstClientInfo; gcClient.RefreshDataSource(); lstPromotionTemplate = proxy.Service.GetPromotionTemplates(null); gcPromotionTemplate.DataSource = lstPromotionTemplate; gcPromotionTemplate.RefreshDataSource(); lstPromotionTemplateConfig = proxy.Service.GetPromotionTemplateConfigs(null); if (lstPromotionTemplate != null) { EntityPromotionTemplate vo = lstPromotionTemplate[0]; gcPromotionTemplateConfig.DataSource = lstPromotionTemplateConfig.FindAll(r => r.templateId == vo.id); gcPromotionTemplateConfig.RefreshDataSource(); } dicPromotionWayConfig = proxy.Service.GetPromotionWayConfigs(); dicPromotionContentConfig = proxy.Service.GetPromotionContentConfigs(); } }
/// <summary> /// 模板 /// </summary> /// <param name="parms"></param> /// <returns></returns> public List <EntityPromotionTemplate> GetPromotionTemplates(List <EntityParm> parms = null) { List <EntityPromotionTemplate> data = null; SqlHelper svc = new SqlHelper(EnumBiz.onlineDB); string Sql = string.Empty; Sql = @"select id, templateName, templateCondition, isEnabled, bakField1, bakField2, createDate, cretateId, creator, modifyDate, modifyId, modifyName from promotionTemplate "; DataTable dt = svc.GetDataTable(Sql); if (dt != null && dt.Rows.Count > 0) { data = new List <EntityPromotionTemplate>(); EntityPromotionTemplate vo = null; foreach (DataRow dr in dt.Rows) { vo = new EntityPromotionTemplate(); vo.id = dr["id"].ToString(); vo.templateName = dr["templateName"].ToString(); vo.templateCondition = dr["templateCondition"].ToString(); vo.isEnabled = dr["isEnabled"].ToString(); vo.bakField1 = dr["bakField1"].ToString(); vo.bakField2 = dr["bakField2"].ToString(); data.Add(vo); } } return(data); }
private void gvPromotionTemplate_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { if (e.RowHandle >= 0) { EntityPromotionTemplate vo = GetRowTemplateObject(); gcPromotionTemplateConfig.DataSource = lstPromotionTemplateConfig.FindAll(r => r.templateId == vo.id); gcPromotionTemplateConfig.RefreshDataSource(); List <EntityPromotionTemplateConfig> lstTmp = lstPromotionSelect.FindAll(r => r.templateId == vo.id); if (lstTmp != null && lstTmp.Count > 0) { foreach (var tmp in lstTmp) { for (int i = 0; i < gvPromotionTemplateConfig.RowCount; i++) { EntityPromotionTemplateConfig ptConfig = gvPromotionTemplateConfig.GetRow(i) as EntityPromotionTemplateConfig; if (tmp.id == ptConfig.id) { gvPromotionTemplateConfig.SelectRow(i); } } } } } }