Exemple #1
0
        private void BindRepeater()
        {
            EmailRepository conUserReb = new EmailRepository();
            DataTable       dataTable  = conUserReb.GetControllerAssignUsers(Convert.ToInt32(txtCotrollerId.Text));

            RepeaterUsersControllers.DataSource = dataTable;
            RepeaterUsersControllers.DataBind();
        }
Exemple #2
0
        private void BindUsersList(string controllerId)
        {
            EmailRepository getControllerAssignUsers = new EmailRepository();
            DataTable       dataTable = getControllerAssignUsers.GetControllerAssignUsers(Convert.ToInt32(controllerId));

            RepeaterUsersEmail.DataSource = dataTable;
            RepeaterUsersEmail.DataBind();
        }
Exemple #3
0
        /*
         * First will search in subject about controllers name or site code or site name
         * if exist go to and insert in database and assign users
         * else go to search in body about same if exist make same
         * if not exist in subject or body Exit from function and don't assign any user in this case Admin will assign manually
         *
         */
        private void AssignAuto(EmailMessage email, int id)
        {
            List <int> controllerId;


            List <int> conIdSub = SubContainsCon(email);

            if (conIdSub[0] == -1)
            {
                List <int> conIdBody = BodyContainsCon(email);
                if (conIdBody[0] == -1)
                {
                    return;
                }
                else
                {
                    controllerId = conIdBody.Distinct().ToList();
                }
            }
            else
            {
                controllerId = conIdSub.Distinct().ToList();
            }


            EmailRepository updateEmail = new EmailRepository();
            string          emailRef    = "NPO#" + id;
            string          emails      = "";

            updateEmail.UpdateStutes(emailRef, id);
            if (controllerId.Count != 0)
            {
                for (int i = 0; i < controllerId.Count; i++)
                {
                    if (controllerId[i] != 0)
                    {
                        updateEmail.AddControllerId(controllerId[i], id);
                        DataTable dataTable = updateEmail.GetControllerAssignUsers(controllerId[i]);
                        foreach (DataRow item in dataTable.Rows)
                        {
                            updateEmail.AddUserEmail(Convert.ToInt32(item["UserId"]), id);
                            emails += item["EmailAddress"].ToString() + ",";
                        }
                    }
                }

                EntityEmail sendEmail = new EntityEmail();

                sendEmail.To      = emails;
                sendEmail.Body    = "you have a new Assign search By Email Reference : " + emailRef;
                sendEmail.Subject = "NPO Tool";

                MailHelper.SendMail(sendEmail);
            }
        }
Exemple #4
0
        protected void AddController_Click(object sender, EventArgs e)
        {
            EmailRepository ControllerReb = new EmailRepository();

            ControllerReb.AddEmailController(Convert.ToInt32(ddlContrcoller.SelectedValue), Convert.ToInt32(txtEmailId.Text));
            DataTable Users = ControllerReb.GetControllerAssignUsers(Convert.ToInt32(ddlContrcoller.SelectedValue));

            foreach (DataRow item in Users.Rows)
            {
                ControllerReb.AddUserEmail(Convert.ToInt32(item["UserId"]), Convert.ToInt32(txtEmailId.Text));
            }


            BindControllerRepeater();
        }
Exemple #5
0
        protected void DeleteController_Click(object sender, ImageClickEventArgs e)
        {
            var             btn                = (ImageButton)sender;
            var             arg                = btn.CommandArgument.ToString().Split(',');
            int             EmailConId         = Convert.ToInt32(arg[0]);
            EmailRepository EmailControllerReb = new EmailRepository();

            EmailControllerReb.DeleteEmailController(EmailConId);
            DataTable Users = EmailControllerReb.GetControllerAssignUsers(Convert.ToInt32(arg[1]));

            foreach (DataRow item in Users.Rows)
            {
                EmailControllerReb.DeleteUserEmail(Convert.ToInt32(txtEmailId.Text), Convert.ToInt32(item["UserId"]));
            }
            BindControllerRepeater();
        }