Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            CikkSelector cs = new CikkSelector();
            cs.ShowDialog();
            if (cs.DialogResult == DialogResult.OK)
            {
                atvCikk = cs.c;
                atvCikk.getKeszlet();
                SetLabels();
                cikkKeszletBindingSource.Clear();
                foreach (var k in atvCikk.lKESZLET)
                {
                    cikkKeszletBindingSource.Add(k);
                }

            }
        }
Esempio n. 2
0
        public frmSelejtez(int cikk, int rakt)
        {
            InitializeComponent();

            _defCikk = cikk;
            _defRaktar = rakt;
             atvCikk =  CikkSelector.SelectCikk(cikk);
             atvCikk.getKeszlet();
             SetLabels();
             // TODO: This line of code loads data into the 'eCAFEDataSetRAKTAR.RAKTAR' table. You can move, or remove it, as needed.
             this.rAKTARTableAdapter.Fill(this.eCAFEDataSetRAKTAR.RAKTAR);
             cikkKeszletBindingSource.Clear();
             foreach (var k in atvCikk.lKESZLET)
             {
                 cikkKeszletBindingSource.Add(k);
             }
        }
Esempio n. 3
0
        public Cikk_list(SqlConnection sc, int _CikkCsop, bool forRendeles)
        {
            sc.Open();
            SqlCommand cmd = new SqlCommand();

            cmd.Connection = sc;

            cmd.CommandType = CommandType.Text;

            cmd.CommandText = "SELECT CIKK_ID, MEGNEVEZES, CIKK_TIPUS, CIKKCSOPORT_ID, isnull(OTHER_FILTER_ID,-1) as OTHER_FILTER_ID, isnull(DEFAULT_RAKTAR,-1) as DEFAULT_RAKTAR, " +
                                " isnull(ERTEKESITES_TIPUSA,'D') as ERT_TIPUS, isnull(l.LIT_KISZ_NEV,'') as KISZ_NEV, isnull(l.LIT_KISZ_MENNY,'1') as KISZ_MENNY, isnull(LIT_KISZ_ID,-1) as LIT_KISZ_ID  " +
                                " FROM CIKK c left join LIT_KISZ l on c.CIKK_ID = l.LIT_KISZ_CIKK_Id "+
                                " WHERE AKTIV = 1 and c.CIKKCSOPORT_ID = " + _CikkCsop;

            SqlDataReader rdr = cmd.ExecuteReader();
            while (rdr.Read())
            {
                try
                {
                    Cikk t = new Cikk((int)rdr["CIKK_ID"], (int)rdr["LIT_KISZ_ID"]);

                    t.ALCSOPORT = (int)rdr["OTHER_FILTER_ID"];
                    t.ALAP_RAKTAR = (int)rdr["DEFAULT_RAKTAR"];
                    t.ERTEKESITES_TIPUSA = (string)rdr["ERT_TIPUS"];
                    t.KISZ_MEGN = (string)rdr["KISZ_NEV"];
                    t.KISZ_MENNY = (double)rdr["KISZ_MENNY"];
                    t.LIT_KISZ_ID = (int)rdr["LIT_KISZ_ID"];
                    t.getKeszlet();
                    lCIKK.Add(t);
                }
                catch (Exception e)
                {
                    DEFS.log(Level.Exception, "Sikertelen betöltés, <null> érték az adatbázisban");
                    DEFS.ExLog(e.Message + "--->" + e.StackTrace);
                }

            }
            rdr.Close();
            sc.Close();
        }
Esempio n. 4
0
        public Cikk_list(CikkListContructType loadType)
        {
            SqlConnection sc = new SqlConnection(DEFS.ConSTR);
            sc.Open();
            SqlCommand cmd = new SqlCommand();

            cmd.Connection = sc;

            cmd.CommandType = CommandType.Text;
            switch (loadType)
            {
                case CikkListContructType.CikkSelector:
                    {
                        #region CikkListContructType.CikkSelector
                        cmd.CommandText = "SELECT CIKK_ID, MEGNEVEZES, CIKK_TIPUS, CIKKCSOPORT_ID, MEGYS_ID, isnull(DEFAULT_RAKTAR,-1) as DEFAULT_RAKTAR FROM CIKK c WHERE AKTIV = 1 and CIKK_TIPUS = 0";
                        SqlDataReader rdr = cmd.ExecuteReader();
                        while (rdr.Read())
                        {
                            try
                            {
                                Cikk t = new Cikk((int)rdr["CIKK_ID"], (string)rdr["MEGNEVEZES"], (int)rdr["CIKK_TIPUS"], (int)rdr["CIKKCSOPORT_ID"]);
                                t.MEGYS_ID = (string)rdr["MEGYS_ID"];
                                t.ALAP_RAKTAR = (int)rdr["DEFAULT_RAKTAR"];
                                lCIKK.Add(t);
                            }
                            catch (Exception e)
                            {
                                DEFS.log(Level.Exception, "Sikertelen betöltés, <null> érték az adatbázisban");
                                DEFS.ExLog(e.Message + "--->" + e.StackTrace);
                            }

                        }
                        rdr.Close();
                        break;
                        #endregion
                    }
                case CikkListContructType.CikkselectorKeszlet:
                    {
                        #region CikkListContructType.CikkselectorKeszlet
                        cmd.CommandText = "SELECT CIKK_ID, MEGNEVEZES, CIKK_TIPUS, CIKKCSOPORT_ID, MEGYS_ID, isnull(DEFAULT_RAKTAR,-1) as DEFAULT_RAKTAR FROM CIKK c WHERE AKTIV = 1 and CIKK_TIPUS = 0 ";
                        SqlDataReader rdr = cmd.ExecuteReader();
                        while (rdr.Read())
                        {
                            try
                            {
                                Cikk t = new Cikk((int)rdr["CIKK_ID"], (string)rdr["MEGNEVEZES"], (int)rdr["CIKK_TIPUS"], (int)rdr["CIKKCSOPORT_ID"]);
                                t.MEGYS_ID = (string)rdr["MEGYS_ID"];
                                t.ALAP_RAKTAR = (int)rdr["DEFAULT_RAKTAR"];
                                t.getKeszlet();
                                lCIKK.Add(t);
                            }
                            catch (Exception e)
                            {
                                DEFS.log(Level.Exception, "Sikertelen betöltés, <null> érték az adatbázisban");
                                DEFS.ExLog(e.Message + "--->" + e.StackTrace);
                            }

                        }
                        rdr.Close();
                        break;
                        #endregion
                    }
                case CikkListContructType.FullCikk:
                    {
                        #region CikkListContructType.FullCikk
                        cmd.CommandText = "SELECT CIKK_ID, MEGNEVEZES, CIKK_TIPUS, CIKKCSOPORT_ID, isnull(OTHER_FILTER_ID,-1) as OTHER_FILTER_ID, isnull(DEFAULT_RAKTAR,-1) as DEFAULT_RAKTAR, " +
                                    " isnull(ERTEKESITES_TIPUSA,'D') as ERT_TIPUS " + //, isnull(l.LIT_KISZ_NEV,'') as KISZ_NEV, isnull(l.LIT_KISZ_MENNY,'1') as KISZ_MENNY " +
                                    " FROM CIKK c WHERE CIKK_TIPUS != 2";

                        SqlDataReader rdr = cmd.ExecuteReader();
                        while (rdr.Read())
                        {
                            try
                            {
                                Cikk t = new Cikk((int)rdr["CIKK_ID"], true );
                                t.getKeszlet();
                                lCIKK.Add(t);
                            }
                            catch (Exception e)
                            {
                                DEFS.log(Level.Exception, "Sikertelen betöltés, <null> érték az adatbázisban");
                                DEFS.ExLog(e.Message + "--->" + e.StackTrace);
                            }

                        }
                        rdr.Close();
                        break;
                        #endregion
                    }
                case CikkListContructType.ForRendeles:
                    {
                        #region CikkListContructType.ForRendeles
                        cmd.CommandText = "SELECT CIKK_ID, MEGNEVEZES, CIKK_TIPUS, CIKKCSOPORT_ID, isnull(CIKKSZAM,'') as CIKKSZAM, isnull(OTHER_FILTER_ID,-1) as OTHER_FILTER_ID," +
                                        " isnull(DEFAULT_RAKTAR,-1) as DEFAULT_RAKTAR, isnull(ERTEKESITES_TIPUSA,'D') as ERT_TIPUS, isnull(l.LIT_KISZ_NEV,'') as KISZ_NEV, isnull(l.LIT_KISZ_MENNY,'1') as KISZ_MENNY, " +
                                        " isnull(GYORSKOD,'') as GYORSKOD , isnull(EAN_KOD,'') as EAN_KOD,isnull(SZJ_SZAM,'') as SZJ_SZAM , " +
                                        " isnull(MINIMUM_KESZLET,0) as MINIMUM_KESZLET , isnull(OPTIMALIS_KESZLET,0) as OPTIMALIS_KESZLET , isnull(ELADASI_AR,0) as ELADASI_AR , isnull(MEGJEGYZES,'') as MEGJEGYZES ,isnull(MEGYS_ID,-1) as MEGYS_ID,  " +
                                        " isnull(ELADASI_AR_NETTO,0) as ELADASI_AR_NETTO, isnull(dbo.fn_get_AfaSzaz(cikk_id),20) as AFA_SZAZ,  " +
                                        " isnull(LIT_KISZ_AR,0) as KISZ_ELADASI_AR, isnull(CIKK_ROVID_NEV,'') as ROVID_NEV, CIKK_TOP_LIST, CIKKCSOP_PREFER, isnull(LIT_KISZ_ID,-1) as LIT_KISZ_ID " +
                                " FROM CIKK c left hash join LIT_KISZ l on c.CIKK_ID = l.LIT_KISZ_CIKK_Id WHERE AKTIV = 1 and CIKK_TIPUS != 2 ORDER BY isnull(CIKK_ROVID_NEV,'') ";

                        SqlDataReader rdr = cmd.ExecuteReader();

                        Cikk t;

                        while (rdr.Read())
                        {

                            try
                            {
                                t = new Cikk((int)rdr["CIKK_ID"], (string)rdr["MEGNEVEZES"], (int)rdr["CIKK_TIPUS"], (int)rdr["CIKKCSOPORT_ID"]);

                                t.CIKK_ID = (int)rdr["CIKK_ID"];
                                t.MEGNEVEZES = (string)rdr["MEGNEVEZES"];
                                t.fCIKK_TIPUS = (int)rdr["CIKK_TIPUS"];
                                t.CIKKCSOPORT_ID = (int)rdr["CIKKCSOPORT_ID"];
                                t.ALCSOPORT = (int)rdr["OTHER_FILTER_ID"];
                                t.ALAP_RAKTAR = (int)rdr["DEFAULT_RAKTAR"];
                                t.MEGYS_ID = (string)rdr["MEGYS_ID"];
                                t.ERTEKESITES_TIPUSA = (string)rdr["ERT_TIPUS"];
                                t.CIKKSZAM = (string)rdr["CIKKSZAM"];
                                t.GYORSKOD = (string)rdr["GYORSKOD"];
                                t.EAN = (string)rdr["EAN_KOD"];
                                t.SZJ = (string)rdr["SZJ_SZAM"];
                                t.MEGJEGYZES = (string)rdr["MEGJEGYZES"];
                                t.KISZ_MEGN = (string)rdr["KISZ_NEV"];
                                t.KISZ_MENNY = (double)rdr["KISZ_MENNY"];
                                t.LIT_KISZ_ID = (int)rdr["LIT_KISZ_ID"];
                                t.MINIMUM_KESZLET = (double)rdr["MINIMUM_KESZLET"];
                                t.OPTIMALIS_KESZLET = (double)rdr["OPTIMALIS_KESZLET"];
                                t.ROVID_NEV = (string)rdr["ROVID_NEV"];
                                t.CIKK_TOP_LIST = (int)rdr["CIKK_TOP_LIST"] == 1;
                                t.CIKKCSOP_PREFER = (int)rdr["CIKKCSOP_PREFER"] == 1;
                                //if ((double)rdr["ELADASI_AR"] == 0)
                                if ((string)rdr["ERT_TIPUS"] == "L")
                                {
                                    t.ELADASI_AR = (double)rdr["KISZ_ELADASI_AR"];
                                    //t.NETTO_AR = DEFS.getNetto((double)rdr["KISZ_ELADASI_AR"], (double)rdr["AFA_SZAZ"]);
                                }
                                else
                                {
                                    t.ELADASI_AR = (double)rdr["ELADASI_AR"];
                                    //t.NETTO_AR = (double)rdr["ELADASI_AR_NETTO"];
                                }

                                t.AFA_SZAZ = (double)rdr["AFA_SZAZ"];
                                t.getKeszlet();
                                lCIKK.Add(t);

                            }
                            catch (Exception e)
                            {
                                DEFS.log(Level.Exception, "Sikertelen betöltés, <null> érték az adatbázisban");
                                DEFS.ExLog(e.Message + "--->" + e.StackTrace);
                            }

                        }
                        rdr.Close();
                        break;
                        #endregion
                    }
                default:
                    break;
            }

            sc.Close();
        }
Esempio n. 5
0
        public Cikk_list(Partner p)
        {
            SqlConnection sc = new SqlConnection(DEFS.ConSTR);
            sc.Open();
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = sc;
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select CIKK_ID from cikk_beszallitok WHERE PARTNER_ID = " + p.PARTNER_ID.ToString();

            SqlDataReader rdr = cmd.ExecuteReader();
            while (rdr.Read())
            {
                try
                {
                    Cikk t = new Cikk((int)rdr["CIKK_ID"], true );
                    t.getKeszlet();
                    lCIKK.Add(t);
                }
                catch (Exception e)
                {
                    DEFS.log(Level.Exception, "Sikertelen betöltés, <null> érték az adatbázisban");
                    DEFS.ExLog(e.Message + "--->" + e.StackTrace);
                }
            }
            rdr.Close();
            sc.Close();
        }