Esempio n. 1
0
        /// <summary>
        /// reads in the pool of strippings, that a chosen product has
        /// </summary>
        /// <param name="termekId">the target product name</param>
        /// <returns>DB id of tha targeted product</returns>
        public List <StrippingToChoose> getThePoolOfStrippings(string termekId)
        {
            KeyValuePair <string, string> param = new KeyValuePair <string, string>("@productMinId", termekId);

            mdi.openConnection();
            List <string[]> result = mdi.execPrepQueryInListStringArrWithKVP
                                         (queryReadingInTheStrippingOfTheChosenProductToRenewAcitveRequest, param);

            mdi.closeConnection();
            List <StrippingToChoose> rows = new List <StrippingToChoose>();

            try
            {
                foreach (string[] arr in result)
                {
                    StrippingToChoose strip = new StrippingToChoose();
                    strip.termekKiszerel = Convert.ToInt32(arr[0]);
                    strip.termekQuantId  = Convert.ToInt32(arr[1]);
                    strip.termekHely     = arr[2];
                    rows.Add(strip);
                }
            }
            catch (Exception e)
            {
                throw new ErrorServiceRequOrderGetTheStripPool
                          ("Az adott termék kiszereléseinek betöltése sikertelen (ModReqStrPool) " + e.Message);
            }
            return(rows);
        }
Esempio n. 2
0
        /// <summary>
        /// start to indentify the user - must be the first query step
        /// </summary>
        /// <param name="parent">LoginWindow</param>
        /// <param name="userName">given name by user</param>
        /// <param name="userPwd">given password by user</param>
        /// <returns></returns>
        public string checkDBForThisUser(string userName)
        {
            try
            {
                param = new KeyValuePair <string, string>("@userName", userName);
            }
            catch (Exception e)
            {
                throw new ErrorServiceLoginDBAccess("A lekérdezés összeállítása sikertelen (ModLoginUserSeek) " + e.Message);
            }
            mdi.openConnection();
            List <string[]> resultIdentify = mdi.execPrepQueryInListStringArrWithKVP(queryOfUserIdentify, param);

            mdi.closeConnection();
            if (resultIdentify.Count == 1)
            {
                userId = resultIdentify[0][0];
                return(hashedPwd = resultIdentify[0][1]);
            }
            else if (resultIdentify.Count == 0)
            {
                throw new ErrorServiceLoginDBAccess("Nem megfelelő felhasználónév vagy jelszó");
            }
            else
            {
                throw new ErrorServiceLoginDBAccess("Az adatbázis sérült, több találat is érkezett (ModLoginUserSeek)");
            }
        }
        /// <summary>
        /// gets the accident of the specified user
        /// </summary>
        /// <param name="userId">userId in DB of the user</param>
        /// <returns></returns>
        public List <string[]> getUserConnectedAccidents(string userId)
        {
            List <string[]> result;

            try
            {
                param = new KeyValuePair <string, string>("userId", userId);
            }
            catch (Exception e)
            {
                throw new ErrorServiceProfileDetailsManage("Az adatbázis felé a kérés megalkotása sikertelen (ModPersonAccid) "
                                                           + e.Message);
            }
            mdi.openConnection();
            result = mdi.execPrepQueryInListStringArrWithKVP(queryToGetAccidentsOfUser, param);
            mdi.closeConnection();
            return(result);
        }
Esempio n. 4
0
        /// <summary>
        /// gets the list of OrderingCancelled to show them the user
        /// </summary>
        /// <returns>list of OrderingCancelled</returns>
        public List <OrderingCancelled> getListOfCancelledOrderings()
        {
            List <OrderingCancelled>      listCancelled = new List <OrderingCancelled>();
            KeyValuePair <string, string> param         = new KeyValuePair <string, string>("@erveny", "0");

            mdi.openConnection();
            List <string[]> rows = mdi.execPrepQueryInListStringArrWithKVP(
                queryForReadInRecords, param);

            mdi.closeConnection();
            try
            {
                foreach (string[] rec in rows)
                {
                    listCancelled.Add(convertCancelledOrdering(rec));
                }
            }
            catch (Exception e)
            {
                throw new ErrorOrderingGetTheCancelledPool("A visszavont rendelések adatlista megalkotása sikertelen (ModOrdNorm) " + e.Message);
            }
            return(listCancelled);
        }