private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox2.SelectedIndex < 0)
            {
                MessageBox.Show("Select User Email!!!!");
            }
            else
            {
                string uEmail = comboBox2.SelectedItem.ToString();

                UserSer      userS     = new UserSer();
                int          uID       = userS.GetUserIdByEmail(uEmail);
                ShareTaskSer uS        = new ShareTaskSer();
                List <int>   catIDList = uS.GetCategoryID(LogIn.user_ID, uID);
                //MessageBox.Show(catIDList.Count.ToString());
                CategorySer   cS;
                List <string> catNameList = new List <string>();
                string        catName;

                for (int i = 0; i < catIDList.Count; i++)
                {
                    cS = new CategorySer();
                    //MessageBox.Show(catIDList[i].ToString());
                    catName = cS.GetCategoryName(catIDList[i], LogIn.user_ID);
                    catNameList.Add(catName);
                }

                for (int i = 0; i < catNameList.Count; i++)
                {
                    comboBox3.Items.Add(catNameList[i]);
                }
            }
        }
Пример #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            bool flag = false;

            if (textBox5.Visible == true)
            {
                if (!(textBox4.Text.Equals(textBox5.Text)))
                {
                    MessageBox.Show("Your Retype Password Don't Match");
                    flag = true;
                }
            }

            if (!flag)
            {
                UserSer uService = new UserSer();
                User    uS       = new User();
                uS.UID      = LogIn.user_ID;
                uS.Email    = textBox2.Text;
                uS.Phone    = textBox3.Text;
                uS.UserName = textBox1.Text;
                uS.Password = textBox4.Text;
                uService.Update(uS);
                button5.Visible = false;
            }
        }
        private void EditShareTaskForm_Load(object sender, EventArgs e)
        {
            //List<int> catIDList = new List<int>();
            List <int> userIDList = new List <int>();

            ShareTaskSer uS = new ShareTaskSer();
            //MessageBox.Show(LogIn.user_ID.ToString());
            List <ShareTask> sList = uS.GetAllShared(LogIn.user_ID);
            //MessageBox.Show(sList[0].ReceiverId.ToString());
            //CategorySer catS;
            UserSer userS;
            //string na;
            string email;

            for (int i = 0; i < sList.Count; i++)
            {
                userS = new UserSer();
                email = userS.GetUserEmail(sList[i].ReceiverId);
                //MessageBox.Show(email);
                //catS = new CategorySer();
                //na = catS.GetCategoryName(sList[i].Cat_ID,LogIn.user_ID);
                //comboBox3.Items.Add(na);
                comboBox2.Items.Add(email);
            }
        }
Пример #4
0
        private void UserInfoForm_Load(object sender, EventArgs e)
        {
            UserSer uService = new UserSer();
            User    us       = uService.GetAll(LogIn.user_ID);

            textBox1.Text = us.UserName;
            textBox2.Text = us.Email;
            textBox3.Text = us.Phone;
            textBox4.Text = us.Password;
        }
Пример #5
0
        public ActionResult Edit(int id)
        {
            UserSer ser = new UserSer();

            if (UsModel != null)
            {
                ser.GetUser(id);
            }

            return(View("Index", "WorkWithUser", ser));
        }
Пример #6
0
        public ActionResult Del(int id)
        {
            UserSer ser = new UserSer();

            if (UsModel != null)
            {
                ser.DelUser(id);
            }

            loadUsers();
            return(View("Index", UsModel));
        }
Пример #7
0
        public ActionResult Add(User model)
        {
            UserSer ser = new UserSer();

            if (model != null && ser.GetUser(model.Id).Users.Count == 0)
            {
                ser.AddUser(model.Name, model.BDay);
            }
            else
            {
                ser.UpdateUser(model);
            }
            return(Redirect("~/User"));
        }
Пример #8
0
 private void btnAddCategory_Click_1(object sender, EventArgs e)
 {
     us      = new UserSer();
     user_ID = us.LoginValidity(tBoxUName.Text, tBoxPassword.Text);
     if (user_ID != 0)
     {
         this.Hide();
         HomePage2.home2 = new HomePage2("Inbox");
         HomePage2.home2.Show();
     }
     else
     {
         MessageBox.Show("User Name and Password invalid!!");
     }
 }
Пример #9
0
        // GET: AddUser
        public ActionResult Index(long?id)
        {
            UserSer ser   = new UserSer();
            User    model = new User();

            if (id != null && id != 0)
            {
                var user = ser.GetUser(id).Users.FirstOrDefault();
                model.Id       = user.Id;
                model.Name     = user.Name;
                model.Age      = user.Age;
                model.BDay     = user.BDay;
                model.FilePath = user.FilePath;
            }
            return(View(model));
        }
 private void button2_Click(object sender, EventArgs e)
 {
     if (comboBox2.SelectedIndex < 0)
     {
         MessageBox.Show("Select Reminder");
     }
     else
     {
         UserSer userS    = new UserSer();
         int     viewerID = userS.GetUserIdByEmail(comboBox2.SelectedItem.ToString());
         userS = new UserSer();
         userS.Delete(viewerID, LogIn.user_ID);
         ShareTaskSer uS = new ShareTaskSer();
         uS.Delete(viewerID);
         comboBox2.Items.Remove(comboBox2.SelectedItem);
         comboBox2.Text = "";
     }
 }
 private void button4_Click(object sender, EventArgs e)
 {
     if (comboBox3.SelectedIndex < 0)
     {
         MessageBox.Show("Select Reminder");
     }
     else
     {
         UserSer     userS    = new UserSer();
         int         viewerID = userS.GetUserIdByEmail(comboBox2.SelectedItem.ToString());
         CategorySer cg       = new CategorySer();
         int         catID    = cg.GetCategoryID(comboBox3.SelectedItem.ToString(), LogIn.user_ID);
         userS = new UserSer();
         userS.Delete(viewerID, LogIn.user_ID, catID);
         comboBox3.Items.Remove(comboBox3.SelectedItem);
         comboBox3.Text = "";
     }
 }
Пример #12
0
        public FilePathResult Download()
        {
            string name = "~/Files/data.txt";

            System.IO.File.Delete(Server.MapPath(name));

            FileInfo info = new FileInfo(name);

            if (!info.Exists)
            {
                UserSer ser = new UserSer();
                using (StreamWriter writer = new StreamWriter(Server.MapPath(name), true))
                {
                    foreach (var item in ser.GetUser().Users)
                    {
                        writer.WriteLine(item.Name + "  -  " + item.BDay + "  -  " + (item.BDay != null ? ((DateTime.Today - (DateTime)(item.BDay)).Days / 365).ToString() : ""));
                    }
                }
            }

            return(File(name, "text/plain"));
        }
Пример #13
0
 private void CustomNotificationPopUp(NotificationPopUp obj)
 {
     notifyPopUp = obj;
     if (obj.Notify_Via == 1)
     {
         us = new UserSer();
         string uEmail = us.GetUserEmail(LogIn.user_ID);
         string ms     = obj.Name + "\n\n\n\n" + obj.Description;
         SendEMail(uEmail, ms);
     }
     else if (obj.Notify_Via == 2)
     {
         MessageBox.Show("This is Not Updated Yet. Bacause It has Money to get this service");
     }
     else
     {
         cs      = new CustomNotificationPopUp();
         cs.Top  = 30;
         cs.Left = Screen.PrimaryScreen.Bounds.Width - cs.Width - 30;
         cs.setLabel(obj.Name, obj.Description);
         cs.Show();
     }
 }
Пример #14
0
        public ActionResult AddUserImage(User model)
        {
            if (model.Id == 0)
            {
                return(null);
            }

            UserSer ser = new UserSer();

            if (Request.Files.Count > 0)
            {
                var file = Request.Files[0];

                if (file != null && file.ContentLength > 0)
                {
                    model.FilePath = Path.GetFileName((Guid.NewGuid()).ToString()) + "." + Path.GetFileName(file.FileName).Split('.').ToList().Last();
                    var path = Path.Combine(Server.MapPath("~/Images/"), model.FilePath);
                    file.SaveAs(path);
                }
            }

            ser.AddUserImage(model);
            return(Redirect("~/User"));
        }
Пример #15
0
        public void loadUsers()
        {
            UserSer ser = new UserSer();

            UsModel.Users = ser.GetUser().Users;
        }
Пример #16
0
 public static User findUserByUserName(User user)
 {
     return(UserSer.findUserByUserName(user));
 }
Пример #17
0
 public static int deleteUser(User user)
 {
     return(UserSer.deleteUser(user));
 }
Пример #18
0
 public static int addUser(User user)
 {
     return(UserSer.addUser(user));
 }
Пример #19
0
 public static List <User> getAllUser()
 {
     return(UserSer.getAllUser());
 }
Пример #20
0
 public static User Login(User user)
 {
     return(UserSer.Login(user));
 }
Пример #21
0
 public static int UpdateUser(User user)
 {
     return(UserSer.UpdateUser(user));
 }
Пример #22
0
        private void button1_Click(object sender, EventArgs e)
        {
            TaskSer      tS;
            List <int>   taskIdList = new List <int>();
            int          taskID;
            ShareTaskSer stS;
            int          recID;
            UserSer      uS = new UserSer();

            if (textBox1.Text != null)
            {
                if (uS.EmailValidity(textBox1.Text))
                {
                    if (comboBox1.Items.Count > 0)
                    {
                        for (int i = 0; i < comboBox1.Items.Count; i++)
                        {
                            tS     = new TaskSer();
                            taskID = tS.GetTaskID(comboBox1.Items[i].ToString(), cat_ID);
                            taskIdList.Add(taskID);
                        }
                        uS    = new UserSer();
                        recID = uS.GetUserIdByEmail(textBox1.Text);

                        stS = new ShareTaskSer();
                        ShareTask st = new ShareTask();
                        st.Cat_ID     = cat_ID;
                        st.SenderID   = LogIn.user_ID;
                        st.ReceiverId = recID;
                        stS.Insert(st, LogIn.user_ID);

                        for (int i = 0; i < taskIdList.Count; i++)
                        {
                            stS = new ShareTaskSer();
                            stS.Insert(cat_ID, taskIdList[i], LogIn.user_ID, recID);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Are you share all Project!!!!!!!");
                        uS    = new UserSer();
                        recID = uS.GetUserIdByEmail(textBox1.Text);

                        stS = new ShareTaskSer();
                        ShareTask st = new ShareTask();
                        st.Cat_ID     = cat_ID;
                        st.SenderID   = LogIn.user_ID;
                        st.ReceiverId = recID;
                        stS.Insert(st, LogIn.user_ID);

                        TaskSer    tkList   = new TaskSer();
                        List <int> taskList = tkList.GetAllTaskID(cat_ID);
                        for (int i = 0; i < taskList.Count; i++)
                        {
                            stS = new ShareTaskSer();
                            stS.Insert(cat_ID, taskList[i], LogIn.user_ID, recID);
                        }
                    }
                    MessageBox.Show("Tasks Are Shared!!!!!!!");
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Please Input Valid User Email Address!!");
                }
            }
            else
            {
                MessageBox.Show("Please Input Email Address!!");
            }
        }
Пример #23
0
        private void button1_Click(object sender, EventArgs e)
        {
            User uN = new User();

            if (textBox1.Text != null && !(textBox1.Text.Equals("Name...........")))
            {
                uN.UserName = textBox1.Text;
                if (textBox2.Text != null && !(textBox2.Text.Equals("Email...........")))
                {
                    uN.Email = textBox2.Text;
                    if (textBox3.Text != null && !(textBox3.Text.Equals("Phone...........")))
                    {
                        uN.Phone = textBox3.Text;
                        if (textBox4.Text != null && !(textBox4.Text.Equals("Password...........")))
                        {
                            uN.Password = textBox4.Text;

                            UserSer uSr = new UserSer();
                            uSr.Insert(uN);
                            uSr = new UserSer();
                            int         uid = uSr.GetUserID(uN.UserName);
                            CategorySer cgS = new CategorySer();

                            Category cat = new Category();
                            cat.Name   = "Inbox";
                            cat.UserID = uid;
                            cat.Color  = 0;
                            cgS.Insert(cat, LogIn.user_ID);

                            cat        = new Category();
                            cat.Name   = "Today";
                            cat.UserID = uid;
                            cat.Color  = 0;
                            cgS.Insert(cat, LogIn.user_ID);

                            cat        = new Category();
                            cat.Name   = "Next 7 Day";
                            cat.UserID = uid;
                            cat.Color  = 0;
                            cgS.Insert(cat, LogIn.user_ID);

                            this.Close();
                        }

                        else
                        {
                            MessageBox.Show("Please Input Your Password");
                        }
                    }

                    else
                    {
                        MessageBox.Show("Please Input Your Phone");
                    }
                }

                else
                {
                    MessageBox.Show("Please Input Your Email");
                }
            }

            else
            {
                MessageBox.Show("Please Input Your Name");
            }
        }
Пример #24
0
 public static User GetUserByName(User user)
 {
     return(UserSer.GetUserByName(user));
 }