Beispiel #1
0
        protected void loadDdl()
        {
            var allVersity = new MySQLDatabase().Query("GetAllVersity",
                                                       new Dictionary <string, object> {
            }, true);

            ddlVersity.DataSource = allVersity.Select(x => new
            {
                Text  = x["name"],
                Value = x["id"]
            }).ToList();
            ddlVersity.DataValueField = "Value";
            ddlVersity.DataTextField  = "Text";
            ddlVersity.DataBind();

            var dept = new MySQLDatabase().Query("getDeptByVersityId",
                                                 new Dictionary <string, object> {
                { "@pid", ddlVersity.SelectedValue }
            }, true);

            ddlDepartment.DataSource = dept.Select(x => new
            {
                text  = x["name"],
                value = x["id"]
            }).ToList();
            ddlDepartment.DataTextField  = "text";
            ddlDepartment.DataValueField = "value";
            ddlDepartment.DataBind();
        }
Beispiel #2
0
        protected void loadApprovedStudent()
        {
            var student = new MySQLDatabase().Query("GetApprovedStudentByTeacherCourseId",
                                                    new Dictionary <string, object> {
                { "@tcid", ddlCourseTitle.SelectedValue }
            }, true);

            cblApprovedStudent.DataSource = student.Select(x => new
            {
                t = " " + x["studentId"] + " " + x["FirstName"] + " " + x["LastName"],
                v = x["id"]
            }).ToList();
            cblApprovedStudent.DataTextField  = "t";
            cblApprovedStudent.DataValueField = "v";
            cblApprovedStudent.DataBind();
            if (student.Count == 0)
            {
                cbSelectAll2.Checked = false;
                cbSelectAll2.Visible = false;
            }
            else
            {
                cbSelectAll2.Visible = true;
            }
        }
        protected void LoadAuthor()
        {
            var catagory = new MySQLDatabase().Query("GetAllAuthor", new Dictionary <string, object> {
            }, true);

            ddlAuthor.DataSource = catagory.Select(x => new
            {
                T = x["first_name"] + " " + x["last_name"],
                V = x["id"]
            }).ToList();
            ddlAuthor.DataTextField  = "T";
            ddlAuthor.DataValueField = "V";
            ddlAuthor.DataBind();
            ddlDelateAuthor.DataSource = catagory.Select(x => new
            {
                T = x["first_name"] + " " + x["last_name"],
                V = x["id"]
            }).ToList();
            ddlDelateAuthor.DataTextField  = "T";
            ddlDelateAuthor.DataValueField = "V";
            ddlDelateAuthor.DataBind();
        }
Beispiel #4
0
        public static Collection <BDE> getBDEList()
        {
            var              db      = new MySQLDatabase("SERVER=51.68.230.58;Port=8080;Database=bde;Uid=bdeUser;Pwd=412qIrJSUkM0;", "MySql.Data.MySqlClient");
            DataTable        dt      = db.Select("SELECT * FROM bde");
            Collection <BDE> bdeList = new Collection <BDE>();

            foreach (DataRow dr in dt.Rows)
            {
                BDE bde = new BDE(dr["name"].ToString(), dr["departement"].ToString());
                bdeList.Add(bde);
            }
            return(bdeList);
        }
        protected void LoadCatagory()
        {
            var catagory = new MySQLDatabase().Query("GetAllCategory", new Dictionary <string, object> {
            }, true);

            ddlCategory.DataSource = catagory.Select(x => new
            {
                T = x["catagoty_name"],
                V = x["id"]
            }).ToList();
            ddlCategory.DataTextField  = "T";
            ddlCategory.DataValueField = "V";
            ddlCategory.DataBind();
            ddlDelateCategory.DataSource = catagory.Select(x => new
            {
                T = x["catagoty_name"],
                V = x["id"]
            }).ToList();
            ddlDelateCategory.DataTextField  = "T";
            ddlDelateCategory.DataValueField = "V";
            ddlDelateCategory.DataBind();
        }
Beispiel #6
0
        private void loadDropDownList()
        {
            string          connstr = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
            MySqlConnection conn    = new MySqlConnection(connstr);

            MySqlCommand cmd = new MySqlCommand("GetAllSalutaion", conn);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            conn.Open();
            MySqlDataReader reader = cmd.ExecuteReader();

            ddlSalutation.DataSource     = reader;
            ddlSalutation.DataTextField  = "name";
            ddlSalutation.DataValueField = "id";
            ddlSalutation.DataBind();
            reader.Close();

            cmd                           = new MySqlCommand("GetAllDesignation", conn);
            cmd.CommandType               = System.Data.CommandType.StoredProcedure;
            reader                        = cmd.ExecuteReader();
            ddlDesignation.DataSource     = reader;
            ddlDesignation.DataTextField  = "name";
            ddlDesignation.DataValueField = "id";
            ddlDesignation.DataBind();
            reader.Close();

            cmd                       = new MySqlCommand("GetAllVersity", conn);
            cmd.CommandType           = System.Data.CommandType.StoredProcedure;
            reader                    = cmd.ExecuteReader();
            ddlVersity.DataSource     = reader;
            ddlVersity.DataTextField  = "name";
            ddlVersity.DataValueField = "id";
            ddlVersity.DataBind();
            reader.Close();

            var res = new MySQLDatabase().Query("getDeptByVersityId",
                                                new Dictionary <string, object>()
            {
                { "@pid", ddlVersity.SelectedValue }
            }, true);

            ddlDepartment.DataSource = res.Select(x => new
            {
                T = x["name"],
                V = x["id"]
            }).ToList();
            ddlDepartment.DataTextField  = "T";
            ddlDepartment.DataValueField = "V";
            ddlDepartment.DataBind();
            conn.Close();
        }
        protected void LoadGvFees()
        {
            var data = new MySQLDatabase().Query("GetAllFees",
                                                 new Dictionary <string, object> {
            }, true);

            gvFees.DataSource = data.Select(x => new
            {
                feeId = x["id"],
                type  = x["fee_type"],
                bdt   = x["amount"]
            }).ToList();
            gvFees.DataBind();
        }
Beispiel #8
0
        private void LoadServerList()
        {
            StartLoading();

            myImageData = mydataBase.Select();

            ImgList.Clear();
            for (int i = 0; i < myImageData.Count; i++)
            {
                ImgList.Add(Helper.BitmapToImageSource(myImageData[i].myImg));
            }

            StopLoading();
        }
Beispiel #9
0
        protected void LoadGvShedule()
        {
            var schedule = new MySQLDatabase().Query("GetAllSchedule",
                                                     new Dictionary <string, object> {
            }, true);

            gvShedule.DataSource = schedule.Select(x => new
            {
                day     = x["day"],
                area    = x["place_name"],
                address = x["place_address"],
                time    = x["arrive_time"] + " - " + x["leave_time"]
            }).ToList();
            gvShedule.DataBind();
        }
        protected void LoadGvBooks()
        {
            var books = new MySQLDatabase().Query("GetBookForLibrarian", new Dictionary <string, object> {
            }, true);

            gvBooks.DataSource = books.Select(x => new
            {
                title   = x["title"],
                bookNum = x["book_number"],
                memName = x["firstname"] + " " + x["lastname"],
                memNUm  = x["member_number"],
                tDate   = Convert.ToDateTime(x["date_taken"]).ToString("dd-MM-yyyy"),
                rDate   = Convert.ToDateTime(x["date_tobe_returned"]).ToString("dd-MM-yyyy")
            }).ToList();
            gvBooks.DataBind();
        }
Beispiel #11
0
 protected void LoadCorurse()
 {
     var course = new MySQLDatabase().Query("GetAllCourselListByUserId",
         new Dictionary<string, object>
         {
             {"@uid", User.Identity.GetUserId() }
         }, true);
     ddlSelectCourse.DataSource = course.Select(x => new
     {
         t = x["prefix"] + " " + x["course_no"] + " " + x["course_tittle"] + " " + x["postfix"] + " (" + x["session"] + ")",
         v = x["id"]
     }).ToList();
     ddlSelectCourse.DataTextField = "t";
     ddlSelectCourse.DataValueField = "v";
     ddlSelectCourse.DataBind();
 }
Beispiel #12
0
        protected void ddlVersity_SelectedIndexChanged(object sender, EventArgs e)
        {
            var dept = new MySQLDatabase().Query("getDeptByVersityId",
                                                 new Dictionary <string, object> {
                { "@pid", ddlVersity.SelectedValue }
            }, true);

            ddlDepartment.DataSource = dept.Select(x => new
            {
                text  = x["name"],
                value = x["id"]
            }).ToList();
            ddlDepartment.DataTextField  = "text";
            ddlDepartment.DataValueField = "value";
            ddlDepartment.DataBind();
        }
Beispiel #13
0
        protected void LoadGvBooks()
        {
            var books = new MySQLDatabase().Query("GetAllBooks", new Dictionary <string, object> {
            }, true);

            gvBooks.DataSource = books.Select(x => new
            {
                title    = x["title"],
                price    = x["price"],
                language = x["language"],
                count    = x["COUNT(*)"],
                category = x["catagoty_name"],
                author   = x["first_name"] + " " + x["last_name"]
            }).ToList();
            gvBooks.DataBind();
        }
Beispiel #14
0
        protected void loadDdlteacher()
        {
            var teacherName = new MySQLDatabase().Query("GetTeacherNameByCourseId",
                                                        new Dictionary <string, object> {
                { "cid", ddlCoruseName.SelectedValue }
            }, true);

            ddlTeacherName.DataSource = teacherName.Select(x => new
            {
                t = x["FirstName"] + " " + x["LastName"],
                v = x["teacherId"]
            }).ToList();
            ddlTeacherName.DataTextField  = "t";
            ddlTeacherName.DataValueField = "v";
            ddlTeacherName.DataBind();
        }
Beispiel #15
0
        public static Collection <Product> getProductList()
        {
            var                  db       = new MySQLDatabase("SERVER=51.68.230.58;Port=8080;Database=bde;Uid=bdeUser;Pwd=412qIrJSUkM0;", "MySql.Data.MySqlClient");
            DataTable            dt       = db.Select("SELECT * FROM products");
            Collection <Product> products = new Collection <Product>();

            foreach (DataRow dr in dt.Rows)
            {
                Product product = new Product(
                    int.Parse(dr["idProduct"].ToString()),
                    dr["nameProduct"].ToString(),
                    float.Parse(dr["prix"].ToString()),
                    dr["imageUrl"].ToString());
                products.Add(product);
            }
            return(products);
        }
        protected void LoadGvCtAss()
        {
            var table = new MySQLDatabase().Query("GetSidSnameMarksMarkIdByMarkSectionID",
                                                  new Dictionary <string, object>
            {
                { "@mrsid", ddlCtAss.SelectedValue }
            }, true);

            gvCtAss.DataSource = table.Select(x => new
            {
                StudentID = x["studentId"],
                Name      = x["FirstName"] + " " + x["LastName"],
                Marks     = x["mark"],
                MarkID    = x["id"]
            }).ToList();
            gvCtAss.DataBind();
        }
        protected void LoadCtAssDdl()
        {
            var CtAss = new MySQLDatabase().Query("GetAllCtAssByTCID",
                                                  new Dictionary <string, object>
            {
                { "@tcid", ddlSelectCourse.SelectedValue }
            }, true);

            ddlCtAss.DataSource = CtAss.Select(x => new
            {
                t = x["name"],
                v = x["id"]
            }).ToList();
            ddlCtAss.DataTextField  = "t";
            ddlCtAss.DataValueField = "v";
            ddlCtAss.DataBind();
        }
Beispiel #18
0
        protected void loadDdlsession()
        {
            var session = new MySQLDatabase().Query("GetSessionByTeacherIdCourseId",
                                                    new Dictionary <string, object>
            {
                { "@tid", ddlTeacherName.SelectedValue },
                { "@cid", ddlCoruseName.SelectedValue }
            }, true);

            ddlSession.DataSource = session.Select(x => new
            {
                t = x["session"],
                v = x["id"]
            }).ToList();
            ddlSession.DataTextField  = "t";
            ddlSession.DataValueField = "v";
            ddlSession.DataBind();
        }
Beispiel #19
0
        protected void LoadGvBooks()
        {
            var uid   = User.Identity.GetUserId();
            var books = new MySQLDatabase().Query("GetBookHistoryByUid",
                                                  new Dictionary <string, object>
            {
                { "uid", uid }
            }, true);

            gvBooks.DataSource = books.Select(x => new
            {
                title = x["title"],
                num   = x["book_number"],
                date  = Convert.ToDateTime(x["date_taken"]).ToString("dd-MM-yyyy"),
                has   = x["has_returned"]
            }).ToList();
            gvBooks.DataBind();
        }
Beispiel #20
0
        protected void AsStudent()
        {
            if (User.IsInRole("Teacher"))
            {
                divStudent.Visible = !true;
                divTeacher.Visible = true;
                var designation = new MySQLDatabase().Query("GetAllDesignation", new Dictionary <string, object> {
                }, true);

                ddlDesignation.DataSource = designation.Select(x => new
                {
                    t = x["name"],
                    v = x["id"]
                }).ToList();
                ddlDesignation.DataValueField = "v";
                ddlDesignation.DataTextField  = "t";
                var td = new MySQLDatabase().QueryValue("GetDesignationIDByUserId",
                                                        new Dictionary <string, object> {
                    { "@uid", User.Identity.GetUserId() }
                }, true);
                ddlDesignation.SelectedValue = td.ToString();
                ddlDesignation.DataBind();
            }
            else
            {
                var ursId     = User.Identity.GetUserId();
                var studentId = new MySQLDatabase().QueryValue("GetStudentIdByUserId",
                                                               new Dictionary <string, object>
                {
                    { "@uid", ursId }
                }, true);

                lblStudentID.InnerText = studentId.ToString();

                var batch = new MySQLDatabase().QueryValue("GetBatchByUserId",
                                                           new Dictionary <string, object>
                {
                    { "@uid", ursId }
                }, true);
                lblBatch.InnerText = batch.ToString();

                divStudent.Visible = true;
            }
        }
Beispiel #21
0
        protected void loadDdlcourse()
        {
            var usr  = User.Identity.GetUserId();
            var vdid = new MySQLDatabase().QueryValue("GetVersityDeptIdByUserId",
                                                      new Dictionary <string, object> {
                { "@uid", usr }
            }, true);
            var courseName = new MySQLDatabase().Query("GetCouserPreFixCodeNameByVersityDeptId",
                                                       new Dictionary <string, object>
            {
                { "@vdid", vdid }
            }, true);

            ddlCoruseName.DataSource = courseName.Select(x => new
            {
                t = x["prefix"] + " " + x["course_no"] + " " + x["course_tittle"] + " " + x["postfix"],
                v = x["id"]
            }).ToList();
            ddlCoruseName.DataValueField = "v";
            ddlCoruseName.DataTextField  = "t";
            ddlCoruseName.DataBind();
        }
        protected void loadDdlDropSession()
        {
            var userId    = User.Identity.GetUserId();
            var teacherId = new MySQLDatabase().QueryValue("GetTeacherIdByUserId",
                                                           new Dictionary <string, object>()
            {
                { "@uid", userId }
            }, true);

            var session = new MySQLDatabase().Query("GetSessionByTeacherId",
                                                    new Dictionary <string, object>
            {
                { "@tid", teacherId }
            }, true);

            ddlDropSession.DataSource = session.Select(x => new
            {
                t = x["session"],
                v = x["id"]
            }).ToList();
            ddlDropSession.DataTextField  = "t";
            ddlDropSession.DataValueField = "v";
            ddlDropSession.DataBind();
        }