private void btCopy_Click(object sender, EventArgs e) { int count = channelSet.Count; int selectIndex = lstvSP.SelectedIndices[0]; int itemIndex = (int)lstvSP.SelectedItems[0].Tag; StorageProcedure frm = new StorageProcedure(channelSet, channelSet[itemIndex]); frm.ShowDialog(this); if (channelSet.Count > count) { ShowSPList(); int i = 0; foreach (ListViewItem viewItem in lstvSP.Items) { if ((int)viewItem.Tag == count) { lstvSP.Items[i].Selected = true; break; } i++; } } }
public IEnumerable <AddSgtinResult> AddNewSgtin(int?naklId, int?naklItemId, string[] sgtins) { const string procName = "chz_scanned_sgtins__add"; var str = ""; for (var i = 0; i < sgtins.Length; i++) { if (i < sgtins.Length - 1) { str += sgtins[i] + ","; } else { str += sgtins[i]; } } var parameter = new AddSgtinParameter() { NaklId = naklId, NaklItemId = naklItemId, Sgtins = sgtins }; var storageProcedure = StorageProcedure <AddSgtinResult> .Create(ConnectionString, procName, parameter : parameter); return(storageProcedure.ExecuteReader()); }
//public HomeController() //{ // _procedure = new StorageProcedure(); //} public HomeController(MusicDbContextRepository dbRepository, StorageProcedure procedure /*, MusicRepository<Song> songRepository, * MusicRepository<Singer> singerRepository, MusicRepository<Album> albumRepository*/) { //_singerRepository = singerRepository; //_songRepository = songRepository; //_albumRepository = albumRepository; _dbRepository = dbRepository; _procedure = procedure; }
private void lstvSP_DoubleClick(object sender, EventArgs e) { int selectIndex = lstvSP.SelectedIndices[0]; int itemIndex = (int)lstvSP.SelectedItems[0].Tag; StorageProcedure frm = new StorageProcedure(channelSet, itemIndex); frm.ShowDialog(this); ShowSPList(); lstvSP.Items[selectIndex].Selected = true; }
public IEnumerable <NaklItem> Get(int naklId) { const string procedureName = "chz_get_nakl_items"; var parameter = new NaklIdParameter() { Id = naklId }; var procedure = StorageProcedure <NaklItem> .Create(ConnectionString, procedureName, parameter : parameter); return(procedure.ExecuteReader()); }
public int Add(string inn, string name, string shortName) { const string procedureName = @"chz_add_company"; var parameter = new AddCompanyParameter() { Inn = inn, Name = name, ShortName = shortName }; var storageProcedure = StorageProcedure <CompanyIdParameter> .Create(ConnectionString, procedureName, parameter : parameter); return(storageProcedure.ExecuteResult().Id); }
private void btnSPAdd_Click(object sender, EventArgs e) { int count = channelSet.Count; StorageProcedure frm = new StorageProcedure(channelSet); frm.ShowDialog(this); if (channelSet.Count > count) { ShowSPList(); int i = 0; foreach (ListViewItem viewItem in lstvSP.Items) { if ((int)viewItem.Tag == count) { lstvSP.Items[i].Selected = true; break; } i++; } } }