Пример #1
0
        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++;
                }
            }
        }
Пример #2
0
        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());
        }
Пример #3
0
        //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;
        }
Пример #4
0
        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;
        }
Пример #5
0
        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());
        }
Пример #6
0
        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);
        }
Пример #7
0
        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++;
                }
            }
        }