protected void IsUserNameUnique(object sender, EventArgs e)
    {
        YASA_PL.YASA_PLContainer x = new YASA_PL.YASA_PLContainer();

        Int64 licznik = 0;
        var   users   = from u in x.Customer_PartSet
                        select u;

        foreach (var item in users)
        {
            if (item.Number == TextBox1.Text)
            {
                licznik = licznik + 1;
            }
        }
        if (licznik > 0)
        {
            RegularExpressionValidator1.ErrorMessage = "Detal o identycznym numerze juz istnieje";
            RegularExpressionValidator1.Enabled      = true;
        }
        else
        {
            RegularExpressionValidator1.Enabled = false;
        }
    }
    protected void IsUserNameUnique(object sender, EventArgs e)
    {
        YASA_PL.YASA_PLContainer x = new YASA_PL.YASA_PLContainer();

        Int64 licznik = 0;
        var   users   = from u in x.Tool_Holder_SystemSet
                        select u;

        foreach (var item in users)
        {
            if (item.Name == TextBox1.Text)
            {
                licznik = licznik + 1;
            }
        }
        if (licznik > 0)
        {
            RegularExpressionValidator1.ErrorMessage = "Podany sposób mocowania narzędzia już istnieje";
            RegularExpressionValidator1.Enabled      = true;
        }
        else
        {
            RegularExpressionValidator1.Enabled = false;
        }
    }
    protected void IsUserNameUnique(object sender, EventArgs e)
    {
        YASA_PL.YASA_PLContainer x = new YASA_PL.YASA_PLContainer();

        Int64 licznik = 0;
        var   users   = from u in x.Contractor_categorySet
                        select u;

        foreach (var item in users)
        {
            if (item.Nazwa == TextBox1.Text)
            {
                licznik = licznik + 1;
            }
        }
        if (licznik > 0)
        {
            RegularExpressionValidator1.ErrorMessage = "Podany nazwa branży już istnieje";
            RegularExpressionValidator1.Enabled      = true;
        }
        else
        {
            RegularExpressionValidator1.Enabled = false;
        }
    }
Esempio n. 4
0
    private bool IsAuthenticUser(string username, string password)
    {
        YASA_PL.YASA_PLContainer x = new YASA_PL.YASA_PLContainer();

        var users = from u in x.Users
                    select u;

        foreach (var item in users)
        {
            if (item.Email == username && item.Password == password)
            {
                //HttpCookie myCookie = new HttpCookie("UserDataInfo");
                //myCookie["Id"] = item.M_Phone_No.ToString();
                ID_USER_INT = item.Id;
                ID_USER     = item.Id.ToString();
                return(true);
            }
        }

        return(false);
    }
    protected void IsUserNameUnique(object sender, EventArgs e)
    {
        YASA_PL.YASA_PLContainer x = new YASA_PL.YASA_PLContainer();

        Int64 licznik = 0;
        var   users   = from u in x.ContractorSet
                        select u;

        foreach (var item in users)
        {
            if (item.Name == TextBox1.Text)
            {
                licznik = licznik + 1;
            }
        }
        if (licznik > 0)
        {
            RegularExpressionValidator1.ErrorMessage = "Podany nazwa klienta już istnieje";
            RegularExpressionValidator1.Enabled      = true;
        }
        else
        {
            RegularExpressionValidator1.Enabled = false;
        }


        //sprawdzenienie czy nazwa firmy zaczyna sie od duzej litery
        if (!Char.IsUpper(TextBox1.Text[0]))
        {
            RegularExpressionValidator1.ErrorMessage = "Nazwa firmy musi zaczynać sie od dużej litery";
            RegularExpressionValidator1.Enabled      = true;
        }
        else
        {
            RegularExpressionValidator1.Enabled = false;
        }
    }
Esempio n. 6
0
        public override string[] GetRolesForUser(string username)
        {
            List <string> roles = new List <string>();

            YASA_PL.YASA_PLContainer x = new YASA_PL.YASA_PLContainer();

            var users = from u in x.Users
                        select u;

            foreach (var item in users)
            {
                if (item.Email == userName)
                {
                    //Customer
                    if (item.R_Customer_View)
                    {
                        roles.Add("R_Customer_View");
                    }
                    if (item.R_Customer_Insert)
                    {
                        roles.Add("R_Customer_Insert");
                    }
                    if (item.R_Customer_Edit)
                    {
                        roles.Add("R_Customer_Edit");
                    }
                    if (item.R_Customer_Delete)
                    {
                        roles.Add("R_Customer_Delete");
                    }

                    return(roles.ToArray());
                }
            }
            return(roles.ToArray());
        }
Esempio n. 7
0
    string[] LookupUserDataFor(string userName)
    {
        List <string> UserData = new List <string>();

        YASA_PL.YASA_PLContainer x = new YASA_PL.YASA_PLContainer();

        var users = from u in x.Users
                    select u;

        foreach (var item in users)
        {
            if (item.Id.ToString() == userName)
            {
                UserData.Add(item.F_Name);
                UserData.Add(item.L_Name);
                UserData.Add(item.DepartmentId.ToString());
                return(UserData.ToArray());
            }
        }



        return(UserData.ToArray());
    }
Esempio n. 8
0
        public override string[] GetRolesForUser(string username)
        {
            List <string> roles = new List <string>();

            YASA_PL.YASA_PLContainer x = new YASA_PL.YASA_PLContainer();

            var users = from u in x.Users
                        select u;

            foreach (var item in users)
            {
                if (item.Id.ToString() == username)
                {
                    //Customer
                    if (item.Customer_List == true)
                    {
                        roles.Add("Customer_List");
                    }
                    if (item.Customer_Insert == true)
                    {
                        roles.Add("Customer_Insert");
                    }
                    if (item.Customer_Edit == true)
                    {
                        roles.Add("Customer_Edit");
                    }
                    if (item.Customer_Delete == true)
                    {
                        roles.Add("Customer_Delete");
                    }
                    //Customer PART and PRODUCT
                    if (item.Customer_Part_List == true)
                    {
                        roles.Add("Customer_Part_List");
                    }
                    if (item.Customer_Part_Insert == true)
                    {
                        roles.Add("Customer_Part_Insert");
                    }
                    if (item.Customer_Part_Edit == true)
                    {
                        roles.Add("Customer_Part_Edit");
                    }
                    if (item.Customer_Part_Delete == true)
                    {
                        roles.Add("Customer_Part_Delete");
                    }
                    //Customer ORDER
                    if (item.Customer_Order_List == true)
                    {
                        roles.Add("Customer_Order_List");
                    }
                    if (item.Customer_Order_Insert == true)
                    {
                        roles.Add("Customer_Order_Insert");
                    }
                    if (item.Customer_Order_Edit == true)
                    {
                        roles.Add("Customer_Order_Edit");
                    }
                    if (item.Customer_Order_Delete == true)
                    {
                        roles.Add("Customer_Order_Delete");
                    }
                    //CONTRACTOR
                    if (item.Contractor_List == true)
                    {
                        roles.Add("Contractor_List");
                    }
                    if (item.Contractor_Insert == true)
                    {
                        roles.Add("Contractor_Insert");
                    }
                    if (item.Contractor_Edit == true)
                    {
                        roles.Add("Contractor_Edit");
                    }
                    if (item.Contractor_Delete == true)
                    {
                        roles.Add("Contractor_Delete");
                    }
                    //CONTRACTOR ORDER
                    if (item.Contractor_Order_List == true)
                    {
                        roles.Add("Contractor_Order_List");
                    }
                    if (item.Contractor_Order_Insert == true)
                    {
                        roles.Add("Contractor_Order_Insert");
                    }
                    if (item.Contractor_Order_Edit == true)
                    {
                        roles.Add("Contractor_Order_Edit");
                    }
                    if (item.Contractor_Order_Delete == true)
                    {
                        roles.Add("Contractor_Order_Delete");
                    }
                    //NOTIFICATION
                    if (item.Notification_List == true)
                    {
                        roles.Add("Notification_List");
                    }
                    if (item.Notification_Insert == true)
                    {
                        roles.Add("Notification_Insert");
                    }
                    if (item.Notification_Edit == true)
                    {
                        roles.Add("Notification_Edit");
                    }
                    if (item.Notification_Delete == true)
                    {
                        roles.Add("Notification_Delete");
                    }
                    //TASK
                    if (item.Task_List == true)
                    {
                        roles.Add("Task_List");
                    }
                    if (item.Task_Insert == true)
                    {
                        roles.Add("Task_Insert");
                    }
                    if (item.Task_Edit == true)
                    {
                        roles.Add("Task_Edit");
                    }
                    if (item.Task_Delete == true)
                    {
                        roles.Add("Task_Delete");
                    }
                    //TECHNOLOGY
                    if (item.Technology_List == true)
                    {
                        roles.Add("Technology_List");
                    }
                    if (item.Technology_Insert == true)
                    {
                        roles.Add("Technology_Insert");
                    }
                    if (item.Technology_Edit == true)
                    {
                        roles.Add("Technology_Edit");
                    }
                    if (item.Technology_Delete == true)
                    {
                        roles.Add("Technology_Delete");
                    }
                    //CNC PROGRAM
                    if (item.CNC_Program_List == true)
                    {
                        roles.Add("CNC_Program_List");
                    }
                    if (item.CNC_Program_Insert == true)
                    {
                        roles.Add("CNC_Program_Insert");
                    }
                    if (item.CNC_Program_Edit == true)
                    {
                        roles.Add("CNC_Program_Edit");
                    }
                    if (item.CNC_Program_Delete == true)
                    {
                        roles.Add("CNC_Program_Delete");
                    }
                    //TOOL
                    if (item.Tool_List == true)
                    {
                        roles.Add("Tool_List");
                    }
                    if (item.Tool_Insert == true)
                    {
                        roles.Add("Tool_Insert");
                    }
                    if (item.Tool_Edit == true)
                    {
                        roles.Add("Tool_Edit");
                    }
                    if (item.Tool_Delete == true)
                    {
                        roles.Add("Tool_Delete");
                    }
                    //FIXTURE
                    if (item.Fixture_List == true)
                    {
                        roles.Add("Fixture_List");
                    }
                    if (item.Fixture_Insert == true)
                    {
                        roles.Add("Fixture_Insert");
                    }
                    if (item.Fixture_Edit == true)
                    {
                        roles.Add("Fixture_Edit");
                    }
                    if (item.Fixture_Delete == true)
                    {
                        roles.Add("Fixture_Delete");
                    }
                    //QUALITY
                    if (item.Quality_List == true)
                    {
                        roles.Add("Quality_List");
                    }
                    if (item.Quality_Insert == true)
                    {
                        roles.Add("Quality_Insert");
                    }
                    if (item.Quality_Edit == true)
                    {
                        roles.Add("Quality_Edit");
                    }
                    if (item.Quality_Delete == true)
                    {
                        roles.Add("Quality_Delete");
                    }
                    //CMM_PROGRAM
                    if (item.CMM_Program_List == true)
                    {
                        roles.Add("CMM_Program_List");
                    }
                    if (item.CMM_Program_Insert == true)
                    {
                        roles.Add("CMM_Program_Insert");
                    }
                    if (item.CMM_Program_Edit == true)
                    {
                        roles.Add("CMM_Program_Edit");
                    }
                    if (item.CMM_Program_Delete == true)
                    {
                        roles.Add("CMM_Program_Delete");
                    }
                    //USER
                    if (item.Users_List == true)
                    {
                        roles.Add("Users_List");
                    }
                    if (item.Users_Insert == true)
                    {
                        roles.Add("Users_Insert");
                    }
                    if (item.Users_Edit == true)
                    {
                        roles.Add("Users_Edit");
                    }
                    if (item.Users_Delete == true)
                    {
                        roles.Add("Users_Delete");
                    }
                    //FORM TEMPLATES
                    if (item.FormTemplates_List == true)
                    {
                        roles.Add("FormTemplates_List");
                    }
                    if (item.FormTemplates_Insert == true)
                    {
                        roles.Add("FormTemplates_Insert");
                    }
                    if (item.FormTemplates_Edit == true)
                    {
                        roles.Add("FormTemplates_Edit");
                    }
                    if (item.FormTemplates_Delete == true)
                    {
                        roles.Add("FormTemplates_Delete");
                    }
                    //ADMIN
                    if (item.Admin == true)
                    {
                        roles.Add("Admin");
                    }

                    return(roles.ToArray());
                }
            }
            return(roles.ToArray());
        }