private void CategorieSheifSourccConfig_Load(object sender, EventArgs e) { categories = categorieservice.GetCategorieById(this.localCategorieId); if (categories == null || sheifConfig == null) { return; } this.Text = categories.vcClassName + "源网站配置"; DataGridViewComboBoxColumn sheifsources = (DataGridViewComboBoxColumn)this.dataGridView1.Columns[0]; if (sheifsourceinfos != null) { for (int i = 0; i < sheifsourceinfos.Length; i++) { TCG.SheifService.SheifSourceInfo sourceinfo = sheifsourceinfos[i]; sheifsources.Items.Add(sourceinfo.SourceName + "|" + sourceinfo.Id); } } sheifcategorieconfig = sheifConfig.GetSheifCategorieConfigById(this.localCategorieId); if (sheifcategorieconfig == null) { sheifcategorieconfig = new TCG.SheifConfig.SheifCategorieConfig(); sheifcategorieconfig.LocalCategorieId = this.localCategorieId; } else { if (sheifcategorieconfig.SheifSourceId.IndexOf(",") > -1) { string[] sccs = sheifcategorieconfig.SheifSourceId.Split(','); for (int i = 0; i < sccs.Length; i++) { DataGridViewRow row = new DataGridViewRow(); DataGridViewComboBoxCell cel = new DataGridViewComboBoxCell(); if (sheifsourceinfos != null) { for (int n = 0; n < sheifsourceinfos.Length; n++) { TCG.SheifService.SheifSourceInfo sourceinfo = sheifsourceinfos[n]; cel.Items.Add(sourceinfo.SourceName + "|" + sourceinfo.Id); if (sourceinfo.Id == sccs[i]) { cel.Value = sourceinfo.SourceName + "|" + sourceinfo.Id; } } } this.dataGridView1.Rows.Add(); this.dataGridView1.Rows[i].Cells[0] = cel; } } else { DataGridViewComboBoxCell cel = new DataGridViewComboBoxCell(); if (sheifsourceinfos != null) { for (int i = 0; i < sheifsourceinfos.Length; i++) { TCG.SheifService.SheifSourceInfo sourceinfo = sheifsourceinfos[i]; cel.Items.Add(sourceinfo.SourceName + "|" + sourceinfo.Id); if (sourceinfo.Id == sheifcategorieconfig.SheifSourceId) { cel.Value = sourceinfo.SourceName + "|" + sourceinfo.Id; } } } this.dataGridView1.Rows.Add(); this.dataGridView1.Rows[0].Cells[0] = cel; } } this.Closed += new EventHandler(CategorieSheifSourccConfig_Closed); }
/// <remarks/> public void UpdateSheifCategorieConfigAsync(SheifCategorieConfig sheifcategorieconfig) { this.UpdateSheifCategorieConfigAsync(sheifcategorieconfig, null); }
/// <remarks/> public void UpdateSheifCategorieConfigAsync(SheifCategorieConfig sheifcategorieconfig, object userState) { if ((this.UpdateSheifCategorieConfigOperationCompleted == null)) { this.UpdateSheifCategorieConfigOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateSheifCategorieConfigOperationCompleted); } this.InvokeAsync("UpdateSheifCategorieConfig", new object[] { sheifcategorieconfig}, this.UpdateSheifCategorieConfigOperationCompleted, userState); }
public int UpdateSheifCategorieConfig(SheifCategorieConfig sheifcategorieconfig) { object[] results = this.Invoke("UpdateSheifCategorieConfig", new object[] { sheifcategorieconfig}); return ((int)(results[0])); }