示例#1
0
 private void ButtonLogin_Click(object sender, RoutedEventArgs e)
 {
     user.Passwd = passwd_box.Password;
     if (!_userService.IsExistUserWithThisLogin(user.Login))
     {
         MessageBox.Show("User not found!", "LogIn", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     else
     {
         if (!_userService.IsExistsUserByLoginAndPassword(user.Login, user.Passwd))
         {
             MessageBox.Show("Wrong password", "LogIn", MessageBoxButton.OK, MessageBoxImage.Error);
         }
         else
         {
             user = _userService.GetUserByLoginAndPassword(user.Login, user.Passwd);
             var usertype = new BLLClass().GetUserType(user);
             if (usertype.Name == "Admin")
             {
                 AdminWindow adminWindow = new AdminWindow();
                 adminWindow.Show();
                 this.Close();
             }
             else
             {
                 UserWindow userWindow = new UserWindow(user);
                 userWindow.Show();
                 this.Close();
             }
             //open menu
         }
     }
 }
示例#2
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(txtbox_PublisherName.Text))
     {
         ShowMsg("Adding error", "First fill all fields");
     }
     else
     {
         PublisherDTO publisherDTO = new PublisherDTO()
         {
             Name = txtbox_PublisherName.Text
         };
         IBLLClass bLLClass = new BLLClass();
         if (!bLLClass.IsExistPublisher(publisherDTO))
         {
             bLLClass.AddPublisher(publisherDTO);
             publishers.LoadPublishers();
             ShowMsg("Adding", "Publisher added!");
             this.Close();
         }
         else
         {
             ShowMsg("Adding error", "Such publisher already exists!");
         }
     }
 }
示例#3
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(txtbox_FirstName.Text) || string.IsNullOrEmpty(txtbox_LastName.Text) || string.IsNullOrEmpty(txtbox_MiddleName.Text))
     {
         ShowMsg("Adding error", "First fill all fields");
     }
     else
     {
         AuthorDTO authorDTO = new AuthorDTO()
         {
             FirstName = txtbox_FirstName.Text, LastName = txtbox_LastName.Text, MiddleName = txtbox_MiddleName.Text
         };
         IBLLClass bLLClass = new BLLClass();
         if (!bLLClass.IsExistAuthor(authorDTO))
         {
             bLLClass.AddAuthor(authorDTO);
             authors.LoadAuthors();
             ShowMsg("Adding", "Author added!");
             this.Close();
         }
         else
         {
             ShowMsg("Adding error", "Such author already exists!");
         }
     }
 }
 private void ShowClassName()
 {
     tvwClass.Nodes.Clear();
     bllclass = new BLLClass();
     dtClass  = bllclass.GetClassName();
     for (int i = 0; i < dtClass.Rows.Count; i++)
     {
         TreeNode reenode = new TreeNode(dtClass.Rows[i]["ClassName"].ToString());
         tvwClass.Nodes.Add(reenode);
     }
 }
示例#5
0
        private void bindEmployee()
        {
            BLLClass bLLClass = new BLLClass();

            DataSet ds = new DataSet();

            ds = bLLClass.bindEmployees();

            grdView.DataSource = ds;

            grdView.DataBind();
        }
示例#6
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            productDTO.Cost         = numeric_cost.Value;
            productDTO.SellingPrice = numeric_sellingprice.Value;
            productDTO.Count        = numeric_count.Value;
            productDTO.Discount     = numeric_discount.Value;
            IBLLClass _bll = new BLLClass();

            _bll.EditProduct(productDTO);
            products.LoadProducts();
            ShowMsg("Editing", "Product edited!");
            products.Close();
            this.Close();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BLLClass bl = new BLLClass();

            if (Session["username"] == null || Session["name"] == null)
            {
                Response.Redirect("Login.aspx");
            }

            if (Session["username"] != null)
            {
                String username = (String)Session["username"];
                System.Data.DataTable dt_playlist = bl.GetAllPlaylist(username);
                String result_playlist            = "<table align = 'center' border = '0' cellpadding = '5'><tr> ";

                foreach (DataRow row in dt_playlist.Rows)
                {
                    string playlisttitle = row["playlisttitle"].ToString();
                    string playlistid    = row["playlistid"].ToString();


                    result_playlist += "<td align='center' valign='center'> <img src='/assets/playlist.png' alt='description here' /></br>" +
                                       "<a href='/Playlist.aspx?playlistid=" + playlistid + "'>" + playlisttitle + "</a></td>";
                }
                result_playlist += "</tr></table>";
                if (dt_playlist.Rows.Count > 0)
                {
                    DIV.InnerHtml = result_playlist;
                }


                System.Data.DataTable dt_recentlyplayedtracks = bl.GetRecentlyPlayedTracks(username);
                String result_recentlyplayedtracks            = "<div class='search-item-lesswidth'><p> Recently Played Tracks</p>";

                foreach (DataRow row in dt_recentlyplayedtracks.Rows)
                {
                    string tracktitle = row["tracktitle"].ToString();
                    string trackid    = row["trackid"].ToString();


                    result_recentlyplayedtracks += "" +
                                                   "<a href='/Tracks.aspx?trackid=" + trackid + "'>" + tracktitle + "</a></br>";
                }
                result_recentlyplayedtracks += "</div>";
                if (dt_recentlyplayedtracks.Rows.Count > 0)
                {
                    DIV8.InnerHtml = result_recentlyplayedtracks;
                }
            }
        }
        public JsonResult GetAllEmpsDetails()
        {
            try {
                BLLClass bllObj = new BLLClass();
                //  listobj = orig.ConvertAll(x => new Employee{ SomeValue = x.SomeValue });  OR
                EmpModelList    mainObj = new EmpModelList();
                List <DTOClass> list    = new List <DTOClass>();
                list            = bllObj.GetDtoData().Emplist;
                mainObj.Emplist = new List <Employee>();
                foreach (var data in list)
                {
                    Employee empObj = new Employee()
                    {
                        Id           = data.Id,
                        Name         = data.Name,
                        DesgnationId = data.DesgnationId,
                        Designation  = data.Designation,
                        Gender       = data.Gender,
                        DepartmentId = data.DepartmentId,
                        Department   = data.Department,
                        Experience   = data.Experience,
                        Skills       = data.Skills,
                        EmailId      = data.EmailId,
                        ContactNo    = data.ContactNo,
                        SupervisorId = data.SupervisorId,
                        Supervisor   = data.Supervisor,
                        DateOfBirth  = data.DateOfBirth,
                        Address      = data.Address,
                        InsertedBy   = data.InsertedBy,
                        InsertedOn   = data.InsertedOn,
                        UpdatedBy    = data.UpdatedBy,
                        UpdatedOn    = data.UpdatedOn
                    };
                    mainObj.Emplist.Add(empObj);
                }
                var json = new { isSuccess = true, data = mainObj.Emplist };
                return(Json(json, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                var json = new
                {
                    isSuccess = false,
                    message   = ex.Message
                };

                return(Json(json, JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult OnPageLoad()
        {
            EmpModelList mainObj = new EmpModelList();
            BLLClass     bllObj  = new BLLClass();

            mainObj.DesnList       = new List <LookupData>();
            mainObj.DeptList       = new List <LookupData>();
            mainObj.SupervisorList = new List <Employee>();
            DtoList list = new DtoList();

            list.DesnList       = new List <LookupDTO>();
            list.DeptList       = new List <LookupDTO>();
            list.SupervisorList = new List <DTOClass>();
            list = bllObj.GetDtoData();
            foreach (var data in list.DesnList)
            {
                LookupData desgObj = new LookupData()
                {
                    Id   = data.Id,
                    Name = data.Name
                };

                mainObj.DesnList.Add(desgObj);
            }

            foreach (var data in list.DeptList)
            {
                LookupData deptObj = new LookupData()
                {
                    Id   = data.Id,
                    Name = data.Name
                };

                mainObj.DeptList.Add(deptObj);
            }

            foreach (var data in list.SupervisorList)
            {
                Employee superObj = new Employee()
                {
                    Id         = data.Id,
                    Supervisor = data.Supervisor
                };

                mainObj.SupervisorList.Add(superObj);
            }

            return(View(mainObj));
        }
示例#10
0
        private void bindEmployee()
        {
            DataSet ds = new DataSet();

            BLLClass bLLClass = new BLLClass();

            ds = bLLClass.getSingleEmpoly(Convert.ToInt32(Request.QueryString["Employ_id"]));

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                txt_name.Text   = ds.Tables[0].Rows[0]["Employ_name"].ToString();
                txt_salary.Text = ds.Tables[0].Rows[0]["Employ_salary"].ToString();
                txt_dept.Text   = ds.Tables[0].Rows[0]["Employ_dept"].ToString();
            }
        }
示例#11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BLLClass bl = new BLLClass();

            if (Session["username"] != null)
            {
                String username          = (String)Session["username"];
                System.Data.DataTable dt = bl.GetUserDetail(username);
                string result            = "";
                result += "<table align='center' border='0' cellpadding='5'>";
                foreach (DataRow row in dt.Rows)
                {
                    string name  = row["name"].ToString();
                    string email = row["email"].ToString();
                    string city  = row["city"].ToString();
                    result += "<tr><td align='center' valign='center'> Username </td><td>"
                              + username + "</td></tr>";
                    result += "<tr><td align='center' valign='center'> Name </td><td>"
                              + name + "</td></tr>";
                    result += "<tr><td align='center' valign='center'> Email </td><td>"
                              + email + "</td></tr>";
                    result += "<tr><td align='center' valign='center'> City </td><td>"
                              + city + "</td></tr>";
                }
                result       += "</table>";
                DIV.InnerHtml = result;

                System.Data.DataTable dt_recentlyplayedtracks = bl.GetRecentlyPlayedTracks(username);
                String result_recentlyplayedtracks            = "<div class='search-item-lesswidth'><p> Recently Played Tracks</p>";

                foreach (DataRow row in dt_recentlyplayedtracks.Rows)
                {
                    string tracktitle = row["tracktitle"].ToString();
                    string trackid    = row["trackid"].ToString();


                    result_recentlyplayedtracks += "" +
                                                   "<a href='/Tracks.aspx?trackid=" + trackid + "'>" + tracktitle + "</a></br>";
                }
                result_recentlyplayedtracks += "</div>";
                if (dt_recentlyplayedtracks.Rows.Count > 0)
                {
                    DIV8.InnerHtml = result_recentlyplayedtracks;
                }
            }
        }
示例#12
0
        protected void grdView_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "cmdEdit")
            {
                Response.Redirect("AddEmployee.aspx?Employ_id=" + Convert.ToString(e.CommandArgument));
            }


            if (e.CommandName == "cmdDelete")
            {
                BLLClass bLLClass = new BLLClass();

                int d = bLLClass.deleteEmploy(Convert.ToString(e.CommandArgument));

                Response.Redirect("viewEmployee.aspx");
            }
        }
示例#13
0
        public ActionResult CreateClass()
        {
            int schoolid = User.GetSchoolID();
            BLL.ACBaseExecService.ExecSQL("Delete Classes Where SchoolID={0}", schoolid);
            string s = Request.Form["data"];
            BLLClass bc = new BLLClass();
            foreach (var c in s.Split('\n'))
            {
                Models.Class mc = new Models.Class();
                mc.ClassName = c;
                mc.SchoolID = schoolid;
                bc.Add(mc, false);

            }
            bc.Save();
            return Content("T");
        }
        private void _btnLogin_Click(object sender, RoutedEventArgs e)
        {
            Employee employee = new Employee(int.Parse(_txtUName.Text), "", "", _cmType.Text, _txtUPass.Password);

            BLL.BLLClass bll = new BLLClass();
            bool         Res = bll.Login(employee);

            if (Res)
            {
                MainWin mw = new MainWin(employee);
                this.Close();
                mw.ShowDialog();
            }
            else
            {
                MessageBox.Show("نام کاربری یا رمز عبور اشتباه است");
            }
        }
        private void _btnAdd_Click(object sender, RoutedEventArgs e)
        {
            BLL.BLLClass bll = new BLLClass();
            Medicine     m   = new Medicine();

            m.ID    = int.Parse(_txtID.Text);
            m.Name  = _txtName.Text;
            m.Price = float.Parse(_txtPrice.Text);
            bool Res = bll.EditMedicine(m);

            if (Res)
            {
                this.Close();
            }
            else
            {
                MessageBox.Show("error");
            }
        }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BLLClass bl = new BLLClass();

            if (Session["username"] != null)
            {
                String username          = (String)Session["username"];
                System.Data.DataTable dt = bl.GetUserDetail(username);

                foreach (DataRow row in dt.Rows)
                {
                    string name  = row["name"].ToString();
                    string email = row["email"].ToString();
                    string city  = row["city"].ToString();
                    if (!Page.IsPostBack)
                    {
                        dname.Value  = name;
                        demail.Value = Encoder.HtmlAttributeEncode(email);
                        dcity.Value  = Encoder.HtmlAttributeEncode(city);
                    }
                }


                System.Data.DataTable dt_recentlyplayedtracks = bl.GetRecentlyPlayedTracks(username);
                String result_recentlyplayedtracks            = "<div class='search-item-lesswidth'><div> Recently Played Tracks</div>";

                foreach (DataRow row in dt_recentlyplayedtracks.Rows)
                {
                    string tracktitle = row["tracktitle"].ToString();
                    string trackid    = row["trackid"].ToString();


                    result_recentlyplayedtracks += "" +
                                                   "<a href='/Tracks.aspx?trackid=" + trackid + "'>" + tracktitle + "</a></br>";
                }
                result_recentlyplayedtracks += "</div>";
                if (dt_recentlyplayedtracks.Rows.Count > 0)
                {
                    DIV8.InnerHtml = result_recentlyplayedtracks;
                }
            }
        }
示例#17
0
        protected void btn_login_Click(object sender, EventArgs e)
        {
            string username = txt_username.Text;
            string password = txt_password.Text;

            BLLClass bLLClass = new BLLClass();

            int l = bLLClass.verifyLogin(username, password);

            if (l > 0)
            {
                lbl_message.Text = "Login successful";
                Session["login"] = "******";
                Response.Redirect("viewEmployee.aspx");
            }
            else
            {
                lbl_message.Text = "Login unsuccessful";
            }
        }
示例#18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BLLClass bl = new BLLClass();

            if (Request.QueryString["followuser"] != null)
            {
                bl.followUser((String)Session["username"], (String)Encoder.HtmlAttributeEncode(Request.QueryString["followuser"]));
                string scriptText = "alert('Followed Successfully'); window.location='" + Request.ApplicationPath + "ConnectOtherUser.aspx'";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alertMessage", scriptText, true);
            }
            else if (Request.QueryString["unfollowuser"] != null)
            {
                bl.unFollowUser((String)Session["username"], (String)Encoder.HtmlAttributeEncode(Request.QueryString["unfollowuser"]));
                string scriptText = "alert('UnFollowed Successfully'); window.location='" + Request.ApplicationPath + "ConnectOtherUser.aspx'";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alertMessage", scriptText, true);
            }
            else
            {
                DIV.InnerHtml = "";
            }

            String username1 = (String)Session["username"];

            System.Data.DataTable dt_recentlyplayedtracks = bl.GetRecentlyPlayedTracks(username1);
            String result_recentlyplayedtracks            = "<div class='search-item-lesswidth'><p> Recently Played Tracks</p>";

            foreach (DataRow row in dt_recentlyplayedtracks.Rows)
            {
                string tracktitle = row["tracktitle"].ToString();
                string trackid    = row["trackid"].ToString();


                result_recentlyplayedtracks += "" +
                                               "<a href='/Tracks.aspx?trackid=" + trackid + "'>" + tracktitle + "</a></br>";
            }
            result_recentlyplayedtracks += "</div>";
            if (dt_recentlyplayedtracks.Rows.Count > 0)
            {
                DIV8.InnerHtml = result_recentlyplayedtracks;
            }
        }
示例#19
0
        protected void create_employ(object sender, EventArgs e)
        {
            Employ emp = new Employ();

            if (Request.QueryString["Employ_id"] != null)
            {
                emp.Emp_id = Convert.ToInt32(Request.QueryString["Employ_id"]);
            }


            emp.Emp_name = txt_name.Text;

            emp.Emp_salary = Convert.ToDouble(txt_salary.Text);

            emp.Emp_dept = txt_dept.Text;

            BLLClass bLLClass = new BLLClass();

            int id = bLLClass.AddEmploy(emp);



            if (id > 0)
            {
                lbl_message.Text = "Employee inserted successfully with id" + id;
            }


            else
            {
                lbl_message.Text = "Insert unsuccessful";
            }


            if (id == -1)
            {
                lbl_message.Text = "Updated";
            }
        }
示例#20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BLLClass bl = new BLLClass();

            if (Session["username"] == null || Session["name"] == null)
            {
                Response.Redirect("Login.aspx");
            }

            if (Session["username"] != null)
            {
                String username = (String)Session["username"];

                System.Data.DataTable dt_recentlyplayedtracks = bl.GetRecentlyPlayedTracks(username);
                String result_recentlyplayedtracks            = "<div class='search-item-lesswidth'><p> Recently Played Tracks</p>";

                foreach (DataRow row in dt_recentlyplayedtracks.Rows)
                {
                    string tracktitle = row["tracktitle"].ToString();
                    string trackid    = row["trackid"].ToString();


                    result_recentlyplayedtracks += "" +
                                                   "<a href='/Tracks.aspx?trackid=" + trackid + "'>" + tracktitle + "</a></br>";
                }
                result_recentlyplayedtracks += "</div>";
                if (dt_recentlyplayedtracks.Rows.Count > 0)
                {
                    DIV8.InnerHtml = result_recentlyplayedtracks;
                }



                System.Data.DataTable dt = bl.GetPlaylistFromCurrentUser(username);
                string result            = "";
                result += "<table align='center' border='0' cellpadding='5'><tr>";
                foreach (DataRow row in dt.Rows)
                {
                    string playlisttitle  = row["playlisttitle"].ToString();
                    string playlistid     = row["playlistid"].ToString();
                    string usernamefollow = row["usernamefollow"].ToString();


                    result += "<td align='center' valign='center'> <img src='/assets/playlist.png' alt='description here' /></br>" +
                              "<a href='/Playlist.aspx?playlistid=" + playlistid + "'>" + playlisttitle + "</a> by " + usernamefollow + "</td>";
                }
                result       += "</tr></table>";
                DIV.InnerHtml = result;

                System.Data.DataTable dt1 = bl.GetNewAlbums();
                string result1            = "";
                result1 += "<table align='center' border='0' cellpadding='5'><tr>";
                foreach (DataRow row1 in dt1.Rows)
                {
                    string albumtitle = row1["albumtitle"].ToString();
                    string albumId    = row1["albumid"].ToString();

                    result1 += "<td align='center' valign='center'> <img src='/assets/album.png' alt='description here' /></br>" +
                               "<a href='/Album.aspx?albumid=" + albumId + "'>" + albumtitle + "</a></td>";
                }
                result1       += "</tr></table>";
                DIV1.InnerHtml = result1;

                System.Data.DataTable dt2 = bl.GetRecentTrackReleasedByLikedArtist(username);
                string result2            = "";
                result2 += "<table align='center' border='0' cellpadding='5'><tr>";
                foreach (DataRow row2 in dt2.Rows)
                {
                    string tracktitle = row2["tracktitle"].ToString();
                    string trackid    = row2["trackid"].ToString();
                    string artistname = row2["artistname"].ToString();

                    result2 += "<td align='center' valign='center'> <img src='/assets/album.png' alt='description here' /></br>" +
                               "<a href='Tracks.aspx?trackid=" + trackid + "' runat ='server'>" + tracktitle + "</a> by " + artistname + "</td>";
                }
                result2       += "</tr></table>";
                DIV2.InnerHtml = result2;
            }
        }
示例#21
0
 private void _btnShow_Click(object sender, RoutedEventArgs e)
 {
     BLL.BLLClass bll = new BLLClass();
     _dtGrid.ItemsSource = null;
     _dtGrid.ItemsSource = bll.ShowMedicine().DefaultView;
 }
示例#22
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DIV.InnerHtml = "";
            BLLClass bl = new BLLClass();

            if (Session["username"] == null || Session["name"] == null)
            {
                Response.Redirect("Login.aspx");
            }

            if (Session["username"] != null)
            {
                String keyword           = txtNickname.Value;
                System.Data.DataTable dt = bl.GetUsersDetailsByKeyword(keyword);
                string result            = "";
                result += "<table align='left' border='0' cellpadding='5' style='top:155px; left:160px; position: absolute; overflow-y: scroll;'>";
                if (dt.Rows.Count == 0)
                {
                    result       += "<tr><td>No Users Found</td></tr></table>";
                    DIV.InnerHtml = result;
                }
                else
                {
                    Boolean flagUserNameCheck = false;
                    foreach (DataRow row in dt.Rows)
                    {
                        string name     = row["name"].ToString();
                        string city     = row["city"].ToString();
                        string username = row["username"].ToString();

                        if ((String)Session["username"] == username)
                        {
                            flagUserNameCheck = true;
                        }
                        else
                        {
                            string follow = "";
                            if (bl.checkIfFollowExists((String)Session["username"], username) > 0)
                            {
                                follow = "<a class='connectButton' href = '/ConnectOtherUser.aspx?unfollowuser="******"'>unfollow</a>";
                            }
                            else
                            {
                                follow = "<a class='connectButton' href = '/ConnectOtherUser.aspx?followuser="******"'>follow</a>";
                            }
                            result += "<tr><td align='center' valign='center'> <img src='/assets/user.png' alt='description here' /></br>"
                                      + username + "</br>" + name + "</br>" + city + " </br>" + follow + "</td><tr>";
                        }
                    }
                    if (flagUserNameCheck && dt.Rows.Count == 1)
                    {
                        result       += "<tr><td>No Users Found</td></tr></table>";
                        DIV.InnerHtml = result;
                    }

                    else
                    {
                        result       += "</tr></table>";
                        DIV.InnerHtml = result;
                    }
                }
            }
        }