Esempio n. 1
0
 //look up
 public List <ClubMember> ClubMemberStringQuery(stringFields field, string value)
 {
     if (field == stringFields.memberID)
     {
         return(clubMember_Linq_DAL.clubMemberIDQuery(Convert.ToInt32(value)));
     }
     else if (field == stringFields.teudatZehute)
     {
         return(clubMember_Linq_DAL.clubMemberTeudatZehuteQuery(Convert.ToInt32(value)));
     }
     else if (field == stringFields.firstName)
     {
         return(clubMember_Linq_DAL.clubMemberFirstNameQuery(value));
     }
     else if (field == stringFields.lastName)
     {
         return(clubMember_Linq_DAL.clubMemberLastNameQuery(value));
     }
     else if (field == stringFields.gender)
     {
         return(clubMember_Linq_DAL.clubMemberGenderQuery((Gender)Enum.Parse(typeof(Gender), value)));
     }
     else
     {
         Console.WriteLine("WORNG SEARCH PARAMETERS");
         return(null);
     }
 }
Esempio n. 2
0
        /********************************************************************************************************/

        /******************************************* QUERYS *************************************************/

        /*
         * the following methods direct the query according to stringFields / rangeFields field variable's value
         */
        //look up
        public List <Employee> employeeStringQuery(stringFields field, string value, List <Employee> listE = null)
        {
            if (field == stringFields.teudatZehute)
            {
                return(employee_Linq_DAL.employeeIDQuery(Convert.ToInt32(value), listE));
            }
            else if (field == stringFields.departmentID)
            {
                return(employee_Linq_DAL.employeeDPIDQuery(Convert.ToInt32(value), listE));
            }
            else if (field == stringFields.supervisorID)
            {
                return(employee_Linq_DAL.employeeSupervisorIDQuery(Convert.ToInt32(value), listE));
            }
            else if (field == stringFields.firstName)
            {
                return(employee_Linq_DAL.employeeFirstNameQuery(value, listE));
            }
            else if (field == stringFields.lastName)
            {
                return(employee_Linq_DAL.employeeLastNameQuery(value, listE));
            }
            else if (field == stringFields.gender)
            {
                return(employee_Linq_DAL.employeeGenderQuery((Gender)Enum.Parse(typeof(Gender), value), listE));
            }
            else
            {
                Console.WriteLine("WORNG SEARCH PARAMETERS");
                return(null);
            }
        }
Esempio n. 3
0
 public List <Product> productStringQuery(stringFields field, string value, List <Product> listP = null)
 {
     if (field == stringFields.inventoryID)
     {
         return(product_Linq_DAL.productInventoryIDQuery(Convert.ToInt32(value), listP));
     }
     else if (field == stringFields.location)
     {
         return(product_Linq_DAL.productLocationQuery(Convert.ToInt32(value), listP));
     }
     else if (field == stringFields.name)
     {
         return(product_Linq_DAL.productNameQuery(value, listP));
     }
     else if (field == stringFields.type)
     {
         return(product_Linq_DAL.productTypeQuery((Backend.Type)Enum.Parse(typeof(Backend.Type), value), listP));
     }
     else if (field == stringFields.inStock)
     {
         return(product_Linq_DAL.productInStockQuery((InStock)Enum.Parse(typeof(InStock), value), listP));
     }
     else
     {
         Console.WriteLine("WORNG SEARCH PARAMETERS");
         return(null);
     }
 }
Esempio n. 4
0
        /********************************************* <END> ADD/REMOVE/EDIT <END> ****************************************************/

        /*********************************************************** QUERYS **************************************************************/
        /********* STRING QUERY ***********/

        /*
         * will direct the query requested to the correct function in the this.itsDAL interface
         * and return a list containing the query results:
         * all the club members where field equals value
         */
        public List <ClubMember> queryByString(stringFields field, string value)
        {
            if (field == stringFields.firstName || field == stringFields.lastName || field == stringFields.memberID || field == stringFields.teudatZehute || field == stringFields.gender)
            {
                return(itsDAL.ClubMemberStringQuery(field, value));
            }
            Console.WriteLine("WORNG SEARCH PARAMETERS");
            return(null);
        }
Esempio n. 5
0
        /****************************** <END> ADD/REMOVE/EDIT <END> ***********************************/

        /**************************************** QUERYS ************************************************/

        /******** STRING QUERY *********/

        /*
         * will direct the query requested to the correct function in the this.itsDAL interface
         * and return a list containing the query results:
         * a list of all the transactions where field equals value
         */
        public List <Transaction> queryByString(stringFields field, string value)
        {
            if (field == stringFields.transactionID || field == stringFields.is_A_Return || field == stringFields.paymentMethod)
            {
                return(itsDAL.transactionStringQuery(field, value));
            }
            Console.WriteLine("WRONG SEARCH PARAMETERS");
            return(null);
        }
Esempio n. 6
0
        /************************************* QUERYS *******************************************/
        /******* STRING QUERY ********/

        /*
         * will direct the query requested to the correct function in the this.itsDAL interface
         * and return a list containing the query results:
         * all departments where field equals value
         */
        public List <Department> queryByString(stringFields field, string value)
        {
            if (field == stringFields.departmentID || field == stringFields.name)
            {
                return(itsDAL.departmentStringQuery(field, value));
            }
            Console.WriteLine("WRONG SEARCH PARAMETERS");
            return(null);
        }
Esempio n. 7
0
        /****************************** <END> ADD/REMOVE/EDIT <END> **********************************/

        /*************************************** QUERYS *****************************************/
        /*********** STRING QUERY ***************/

        /*
         * will direct the query requested to the correct function in the this.itsDAL interface
         * and return a list containing the query results:
         * a list of all the users where field equals value
         */
        public List <User> queryByString(stringFields field, string value)
        {
            if (field == stringFields.userName)
            {
                return(itsDAL.userStringQuery(field, value));
            }
            Console.WriteLine("WRONG SEARCH PARAMETERS");
            return(null);
        }
Esempio n. 8
0
        /*************************************** <END> ADD/REMOVE/EDIT <END> **************************************/

        /************************************************ QUERYS ******************************************************/
        /********** STRING QUERY ***********/

        /*
         * will direct the query requested to the correct function in the this.itsDAL interface
         * and return a list containing the query results:
         * a list of all the products where field equals value
         */
        public List <Product> queryByString(stringFields field, string value, List <Product> listP = null)
        {
            if (field == stringFields.name || field == stringFields.type || field == stringFields.inventoryID || field == stringFields.location || field == stringFields.inStock)
            {
                List <Product> tempPList = itsDAL.productStringQuery(field, value, listP);
                EmphsizeTopSeller(tempPList);
                return(tempPList);
            }
            Console.WriteLine("WRONG SEARCH PARAMETERS");
            return(null);
        }
Esempio n. 9
0
 //look up
 public List <User> userStringQuery(stringFields field, string value)
 {
     if (field == stringFields.userName)
     {
         return(user_Linq_DAL.userNameQuery(value));
     }
     else
     {
         Console.WriteLine("WORNG SEARCH PARAMETERS");
         return(null);
     }
 }
Esempio n. 10
0
        /******************************* <END> ADD/EDIT/REMOVE <END> ******************************************/

        /************************************* QUERYS ***************************************/

        /********** STRING QUERY **************/

        /*
         * will direct the query requested to the correct function in the this.itsDAL interface
         * and return a list containing the query results:
         * a list of all the employees where field equals value
         */
        public List <Employee> queryByString(stringFields field, string value, List <Employee> list = null)
        {
            if (field == stringFields.teudatZehute || field == stringFields.firstName || field == stringFields.lastName || field == stringFields.departmentID || field == stringFields.supervisorID || field == stringFields.gender)
            {
                if (list == null)
                {
                    return(itsDAL.employeeStringQuery(field, value, list));
                }
            }
            Console.WriteLine("WRONG SEARCH PARAMETERS");
            return(null);
        }
Esempio n. 11
0
 //look up
 public List <Department> departmentStringQuery(stringFields field, string value)
 {
     if (field == stringFields.name)
     {
         return(department_Linq_DAL.departmentNameQuery(value));
     }
     else if (field == stringFields.departmentID)
     {
         return(department_Linq_DAL.departmentIDQuery(Convert.ToInt32(value)));
     }
     else
     {
         Console.WriteLine("WORNG SEARCH PARAMETERS");
         return(null);
     }
 }
Esempio n. 12
0
        /********** STRING QUERY ************/

        /*
         * will direct the query requested to the correct function according to the instance of clas (recieved in function)
         * and return a list containing the query results:
         * a list of objects where: field == Value
         */
        public List <object> queryByString(Classes clas, stringFields field, string value, List <object> listO = null)
        {
            if (clas == Classes.ClubMember)
            {
                return(clubMember_bl.queryByString(field, value).Cast <object>().ToList());
            }
            else if (clas == Classes.Department)
            {
                return(department_bl.queryByString(field, value).Cast <object>().ToList());
            }
            else if (clas == Classes.Employee)
            {
                if (listO != null)
                {
                    return(employee_bl.queryByString(field, value, listO.Cast <Employee>().ToList()).Cast <object>().ToList());
                }
                else
                {
                    return(employee_bl.queryByString(field, value).Cast <object>().ToList());
                }
            }
            else if (clas == Classes.Product)
            {
                if (listO != null)
                {
                    return(prod_bl.queryByString(field, value, listO.Cast <Product>().ToList()).Cast <object>().ToList());
                }
                else
                {
                    return(prod_bl.queryByString(field, value).Cast <object>().ToList());
                }
            }
            else if (clas == Classes.Transaction)
            {
                return(transaction_bl.queryByString(field, value).Cast <object>().ToList());
            }
            else if (clas == Classes.User)
            {
                return(user_bl.queryByString(field, value).Cast <object>().ToList());
            }
            else
            {
                Console.WriteLine("WRONG SEARCH PARAMETERS");
                return(null);
            }
        }
Esempio n. 13
0
 //look up
 public List <Transaction> transactionStringQuery(stringFields field, string value)
 {
     if (field == stringFields.transactionID)
     {
         return(transaction_Linq_DAL.transactionIDQuery(Convert.ToInt32(value)));
     }
     else if (field == stringFields.is_A_Return)
     {
         return(transaction_Linq_DAL.transactionIsAReturnQuery(Convert.ToBoolean(value)));
     }
     else if (field == stringFields.paymentMethod)
     {
         return(transaction_Linq_DAL.transactionPaymentMethodQuery((PaymentMethod)Enum.Parse(typeof(PaymentMethod), value)));
     }
     else
     {
         Console.WriteLine("WORNG SEARCH PARAMETERS");
         return(null);
     }
 }