Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PageAuthorized.check(Request, Response);

            DataSet apptSet = new DataSet();
            Appt    a       = new Appt();

            int initialWall = 1;

            if (IsPostBack)
            {
                initialWall = Convert.ToInt32(wallList.SelectedValue);
            }
            else
            {
                if (!string.IsNullOrEmpty(Request["initial"]))
                {
                    initialWall = Convert.ToInt32(Request["initial"]);
                }
            }

            initWalls(initialWall);
            a["wall_id"]         = initialWall;
            a["organization_id"] = Organization.Current.id.Value;
            a["tzoffset"]        = LiftTime.UserTzOffset;

            apptSet = a.doQuery("get_wall_subscribers");

            wallManageRenderer = new WallManageRenderer(apptSet);
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (LiftDomain.User.IsLoggedIn)
            {
                Appt    a       = new Appt();
                DataSet apptSet = a.doQuery("get_stats");

                wallRenderer = new WallRenderer(apptSet);

                sentence1  = Organization.Current.title.ToString();
                sentence1 += " has ";

                LiftDomain.Wall w     = new LiftDomain.Wall();
                long            walls = w.doCommand("get_wall_count");

                sentence1 += walls.ToString();

                sentence1 += " prayer walls.";

                sentence1 = Language.Current.translate(sentence1);
            }
            else
            {
                Response.Redirect("Login.aspx?target=Wall.aspx");
            }
        }
        public virtual JsonResult Meetings_Update([DataSourceRequest] DataSourceRequest request, Appt meeting)
        {
            if (ModelState.IsValid)
            {
                Appt.Update(meeting, ModelState);
            }

            return(Json(new[] { meeting }.ToDataSourceResult(request, ModelState)));
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string userId = string.Empty;

            userId = Request["user_id"];

            Appt userAppt = new Appt();

            userAppt["user_id"] = userId;
            DataSet userApptSet = userAppt.doQuery("get_user_time");

            if (!DatabaseObject.isNullOrEmpty(userApptSet))
            {
                DataRow apptRow = userApptSet.Tables[0].Rows[0];

                Appt unsub = new Appt();
                unsub["dow"]     = apptRow["my_dow"];
                unsub["tod"]     = apptRow["my_tod"];
                unsub["user_id"] = userId;
                unsub.doCommand("unsubscribe");
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PageAuthorized.check(Request, Response);

            Appt a = new Appt();

            string q = Request["q"];

            a["q"]               = q;
            a["tzoffset"]        = LiftDomain.LiftTime.UserTzOffset;
            a["organization_id"] = Organization.Current.id.Value;
            DataSet userSet = a.doQuery("get_users_like");

            Response.ContentType = "text/plain";

            userRenderer = new WallManageAutoCompleteRenderer(userSet);

            string cell = Request["cell"];

            string[] parts = cell.Split(new char[] { '_' });
            userRenderer.wallId = parts[0];
            userRenderer.dow    = parts[1];
            userRenderer.tod    = parts[2];
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string cell       = string.Empty;
            string wallId     = string.Empty;
            string dow        = string.Empty;
            string tod        = string.Empty;
            string login      = string.Empty;
            string first_name = string.Empty;
            string last_name  = string.Empty;
            string phone      = string.Empty;
            string email      = string.Empty;
            string password   = string.Empty;

            LiftDomain.Organization.setCurrent();

            cell = Request["cell"];
            string[] parts = cell.Split(new char[] { '_' });
            wallId = parts[0];
            dow    = parts[1];
            tod    = parts[2];

            login      = Request["login"];
            first_name = Request["first_name"];
            last_name  = Request["last_name"];
            phone      = Request["phone"];
            email      = Request["email"];
            password   = Request["password"];

            LiftDomain.User thisUser = new LiftDomain.User();

            thisUser.password_hash_type.Value = "md5";
            string saltValue = LiftDomain.User.generateRandomSalt();

            thisUser.password_salt.Value = saltValue;

            thisUser.crypted_password.Value           = LiftDomain.User.hash(password, saltValue);
            thisUser.last_password_changed_date.Value = LiftTime.CurrentTime;

            thisUser.state.Value               = 1;
            thisUser.created_at.Value          = LiftTime.CurrentTime;
            thisUser.last_logged_in_at.Value   = new DateTime(2000, 1, 1, 0, 0, 0); //-- DateTime.MinValue;
            thisUser.login_failure_count.Value = 0;

            thisUser.login.Value = login;
            thisUser.email.Value = email;

            thisUser.first_name.Value     = first_name;
            thisUser.last_name.Value      = last_name;
            thisUser.address.Value        = string.Empty;
            thisUser.city.Value           = string.Empty;
            thisUser.state_province.Value = string.Empty;
            thisUser.postal_code.Value    = string.Empty;
            thisUser.phone.Value          = phone;

            thisUser.time_zone.Value   = Organization.Current.time_zone.Value;
            thisUser.language_id.Value = Organization.Current.language_id.Value;

            thisUser.previous_increment_id.Value = 0;
            thisUser.updated_at.Value            = LiftTime.CurrentTime;

            bool ok = true;

            if (LiftDomain.User.checkEmailExists(email))
            {
                ok = false;
            }

            if (LiftDomain.User.checkUsernameExists(login))
            {
                ok = false;
            }


            if (ok)
            {
                thisUser.id.Value = Convert.ToInt32(thisUser.doCommand("save"));

                Appt a = new Appt();

                a["dow"]     = dow;
                a["tod"]     = tod;
                a["user_id"] = thisUser.id.Value;
                a["wall_id"] = wallId;
                a.doCommand("subscribe");

                userId = thisUser.id.Value.ToString();
                appt   = first_name.Substring(0, 1);
                appt  += ". ";
                appt  += last_name;
            }
        }
Beispiel #7
0
        private void getAppointments()
        {
            //Build the Connection String
            UriBuilder ub = new UriBuilder();

            StringBuilder data = new StringBuilder();
            data.Append("u=" + WebUtility.HtmlEncode(sessionManager.User));
            data.Append("&key=" + WebUtility.HtmlEncode(sessionManager.Key));

            ub.Host = "67.10.181.224/~cookie/emis-dev/Appointments.php";
            ub.Query = data.ToString();

            //Create the request
            Uri requestUri = ub.Uri;
            WebRequest request = WebRequest.Create(requestUri);
            request.Method = "GET";

            try
            {
                WebResponse response = request.GetResponse();

                StreamReader reader = new StreamReader(response.GetResponseStream());
                XmlTextReader xmlReader = new XmlTextReader(response.GetResponseStream());
                while (xmlReader.Read())
                {
                    switch (xmlReader.NodeType)
                    {
                        case XmlNodeType.Element:
                            if (xmlReader.Name == "appt")
                            {
                                Appt newAppt = new Appt();
                                xmlReader.Read();
                                switch (xmlReader.Name)
                                {
                                    case "date":
                                        newAppt.AppointmentTime = xmlReader.ReadElementContentAsDateTime();
                                        break;
                                    case "time":
                                        DateTime time = xmlReader.ReadElementContentAsDateTime();
                                        newAppt.AppointmentTime.AddHours(time.Hour);
                                        newAppt.AppointmentTime.AddMinutes(time.Minute);
                                        break;

                                    default:
                                        break;
                                }

                                appointments.Add(newAppt);
                            }
                            break;
                        default:
                            break;
                    }
                }

            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, "Yeah...we didn't plan for this", MessageBoxButtons.OK);
                Application.Exit();
            }
        }
Beispiel #8
0
        private void getAppointments()
        {
            //Build the Connection String
            UriBuilder ub = new UriBuilder();

            StringBuilder data = new StringBuilder();

            data.Append("u=" + WebUtility.HtmlEncode(sessionManager.User));
            data.Append("&key=" + WebUtility.HtmlEncode(sessionManager.Key));

            ub.Host  = "67.10.181.224/~cookie/emis-dev/Appointments.php";
            ub.Query = data.ToString();

            //Create the request
            Uri        requestUri = ub.Uri;
            WebRequest request    = WebRequest.Create(requestUri);

            request.Method = "GET";

            try
            {
                WebResponse response = request.GetResponse();

                StreamReader  reader    = new StreamReader(response.GetResponseStream());
                XmlTextReader xmlReader = new XmlTextReader(response.GetResponseStream());
                while (xmlReader.Read())
                {
                    switch (xmlReader.NodeType)
                    {
                    case XmlNodeType.Element:
                        if (xmlReader.Name == "appt")
                        {
                            Appt newAppt = new Appt();
                            xmlReader.Read();
                            switch (xmlReader.Name)
                            {
                            case "date":
                                newAppt.AppointmentTime = xmlReader.ReadElementContentAsDateTime();
                                break;

                            case "time":
                                DateTime time = xmlReader.ReadElementContentAsDateTime();
                                newAppt.AppointmentTime.AddHours(time.Hour);
                                newAppt.AppointmentTime.AddMinutes(time.Minute);
                                break;

                            default:
                                break;
                            }

                            appointments.Add(newAppt);
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, "Yeah...we didn't plan for this", MessageBoxButtons.OK);
                Application.Exit();
            }
        }
 public ActionResult Index()
 {
     Appt.Init();
     return(View());
 }