Пример #1
0
        private void dgvRooms_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                var             _clsRooms = new ClsRooms();
                int             rowIndex  = e.RowIndex;
                DataGridViewRow row       = dgvRooms.Rows[rowIndex];
                lblRoomId.Text        = row.Cells[_clsRooms.id].Value.ToString();
                txtFloorNumber.Text   = row.Cells[_clsRooms.floorNumber].Value.ToString();
                txtMaxAdult.Text      = row.Cells[_clsRooms.maxAdults].Value.ToString();
                txtMaxChildren.Text   = row.Cells[_clsRooms.maxChildren].Value.ToString();
                txtPricePerNight.Text = row.Cells[_clsRooms.pricePerNight].Value.ToString();
                txtRoomNumber.Text    = row.Cells[_clsRooms.roomNumber].Value.ToString();
                // var index = cmbRoomType.FindString(row.Cells[7].Value.ToString());

                cmbRoomType.SelectedIndex = cmbRoomType.FindStringExact(row.Cells[_clsRooms.roomType].Value.ToString());
                // cmbRoomType.SelectedValue =  row.Cells[_clsRooms.roomType].Value.ToString();
                if (row.Cells["Active"].Value.ToString().Equals("Y"))
                {
                    cmbActive.SelectedIndex = cmbActive.FindStringExact("Yes");
                }
                else
                {
                    cmbActive.SelectedIndex = cmbActive.FindStringExact("No");
                }
                // setMode("Modify");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Пример #2
0
        private void btnModify_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                var fgResponseCode    = 0;
                var validationMessage = validateInput();

                if (validationMessage == string.Empty)
                {
                    if (MessageBox.Show("Are you sure you want to save", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        var      data      = new Dictionary <string, string>();
                        ClsRooms _clsRooms = new ClsRooms();
                        data.Add(_clsRooms.id, lblRoomId.Text);
                        data.Add(_clsRooms.roomNumber, txtRoomNumber.Text);
                        data.Add(_clsRooms.floorNumber, txtFloorNumber.Text);
                        data.Add(_clsRooms.maxAdults, txtMaxAdult.Text);
                        data.Add(_clsRooms.maxChildren, txtMaxChildren.Text);
                        data.Add(_clsRooms.pricePerNight, txtPricePerNight.Text);
                        data.Add(_clsRooms.roomType, cmbRoomType.Text);
                        int active = 0;
                        if (cmbActive.SelectedItem.ToString().Trim().Equals("Yes"))
                        {
                            active = 1;
                        }
                        else
                        {
                            active = 0;
                        }
                        data.Add(_clsRooms.active, active.ToString());

                        fgResponseCode = _clsRestService.PutRequest(_clsGlobalConstants.rooms, data);
                        if (fgResponseCode != 0)
                        {
                            MessageBox.Show("Operation sucessfully completed....!!!!", "Sucess", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show(_clsRestService.globalResponseMessage.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        clearData();
                        fillRooms();
                    }
                }
                else
                {
                    MessageBox.Show(validationMessage.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Пример #3
0
        protected void ddCampus_SelectedIndexChanged(object sender, EventArgs e)
        {
            //When we switch to the edit view, we are going to disable the validation for the times fields if the course
            //is an inet tnet tele courses.
            //Durring the actual update process, we also check the value so we do not attempt to parse a empty datetime entry
            ClsRooms room = new ClsRooms("MasterSchedule");

            if (!room.CheckIsBrickAndMortar(ddRoom.SelectedItem.Text))
            {
                btnUpdateMeeting.ValidationGroup = "";
            }
            else
            {
                btnUpdateMeeting.ValidationGroup = "editmeeting";
            }
        }
Пример #4
0
        protected void btnUpdateMeeting_Click(object sender, EventArgs e)
        {
            DateTime selectdDate = new DateTime();

            selectdDate = DateTime.Parse(txtEditTermStartDate.Text);
            int semStartDate;

            semStartDate = (int)selectdDate.DayOfWeek;

            updateDateError.Visible = false;
            ClsRooms room = new ClsRooms("MasterSchedule");
            //if (semStartDate != cblDays.SelectedIndex && room.CheckIsBrickAndMortar(ddRoom.SelectedItem.Text))
            //{
            //    updateDateError.Visible = true;
            //}
            //else
            //{
            StringBuilder sb = new StringBuilder();

            sb.Append("<table cellpadding=\"0\" cellspacing=\"0\"><tr>");
            sb.Append("<td colspan=\"2\"><h4>Change Meeting:</h4></td></tr><tr>");
            sb.Append("<td style=\"padding-left:10px;\">From:</td>");
            sb.Append("<td style=\"padding-left:10px;\">To:</td></tr><tr>");
            sb.Append("<td style=\"padding-left:10px;\">");

            ClsSectionMeetings sm = new ClsSectionMeetings("MasterSchedule");

            sm.SectionMeetingsId = int.Parse(UpdateMeetingID.Value);
            sm.GetRecord();
            ClsSections section = new ClsSections("MasterSchedule");

            section.SectionsId = SectionID;
            section.GetRecord();

            room.RoomsId = sm.RoomsId;
            room.GetRecord();
            ClsCampuses campus = new ClsCampuses("MasterSchedule");

            campus.CampusesId = room.CampusesId;
            campus.GetRecord();

            sb.Append("<table cellpadding=\"0\" cellspacing=\"0\">");
            sb.Append("<tr><td style=\"padding-right:5px;\">Campus:</td><td " + MarkOrig(campus.CampusCode, ddCampus.SelectedItem.Text) + "</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">Room:</td><td " + MarkOrig(room.RoomNumber, ddRoom.SelectedItem.Text) + "</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">Days:</td><td>" + sm.MeetDays.Replace(":", "") + "</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">Start Time:</td><td>");

            if (sm.MeetStartTime != DateTime.MinValue)
            {
                sb.Append(sm.MeetStartTime.ToShortTimeString());
            }
            sb.Append("</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">End Time:</td><td>");
            if (sm.MeetEndTime != DateTime.MinValue)
            {
                sb.Append(sm.MeetEndTime.ToShortTimeString());
            }
            sb.Append("</td></tr>");

            sb.Append("<tr><td>Section Start:</td><td " + MarkOrig_DateType(section.SectionStartDate, txtEditTermStartDate.Text) + "</td></tr>");
            sb.Append("<tr><td>Section End:</td><td " + MarkOrig_DateType(section.SectionEndDate, txtEditTermEndDate.Text) + "</td></tr>");
            sb.Append("</table>");

            sb.Append("</td>");
            sb.Append("<td style=\"padding-left:10px;\">");

            sb.Append("<table cellpadding=\"0\" cellspacing=\"0\">");
            sb.Append("<tr><td style=\"padding-right:5px;\">Campus:</td><td " + MarkChanges(campus.CampusCode, ddCampus.SelectedItem.Text) + "</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">Room:</td><td " + MarkChanges(room.RoomNumber, ddRoom.SelectedItem.Text) + "</td></tr>");

            sb.Append("<tr><td style=\"padding-right:5px;\">Days:</td><td>");
            foreach (ListItem item in cblDays.Items)
            {
                if (item.Selected)
                {
                    if (_meetChanged)
                    {
                        sb.Append("<strong>");
                    }
                    sb.Append(item.Value); if (_meetChanged)
                    {
                        sb.Append("</strong>");
                    }
                }
            }

            sb.Append("</td></tr>");

            sb.Append("<tr><td style=\"padding-right:5px;\">Start Time:</td><td " + MarkChanges_TimeType(sm.MeetStartTime, txtStartTime.Text) + "</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">End Time:</td><td " + MarkChanges_TimeType(sm.MeetEndTime, txtEndTime.Text) + "</td></tr>");

            sb.Append("<tr><td>Start Date:</td><td " + MarkChanges_DateType(section.SectionStartDate, txtEditTermStartDate.Text) + "</td></tr>");
            sb.Append("<tr><td>End Date:</td><td " + MarkChanges_DateType(section.SectionEndDate, txtEditTermEndDate.Text) + "</td></tr>");
            sb.Append("</table>");

            sb.Append("</td></tr></table>");

            log.SectionsId   = int.Parse(Request["SectionsID"]);
            log.SubmittedBy  = Session["deltaid"].ToString();
            log.Change       = sb.ToString();
            log.ProcessGroup = "divsionchairs";
            log.AddRecord();

            Helpers.RefreshSortPending((GridView)Helpers.FindControlRecursive(Page.Master, "gvPendingChanges")); //Refresh the pending list

            MultiView1.ActiveViewIndex = 0;
            UpdateMeetingID.Value      = "";
            //}
        }
Пример #5
0
        protected void gvMeetings_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "editmeeting")
            {
                UpdateMeetingID.Value      = e.CommandArgument.ToString();
                MultiView1.ActiveViewIndex = 1;
                ClsSectionMeetings meeting = new ClsSectionMeetings("MasterSchedule");
                meeting.SectionMeetingsId = int.Parse(e.CommandArgument.ToString());
                meeting.GetRecord();
                ClsRooms room = new ClsRooms("MasterSchedule");
                room.RoomsId = meeting.RoomsId;
                room.GetRecord();

                ddCampus.DataBind();
                ddCampus.SelectedValue = room.CampusesId.ToString();

                ddRoom.DataBind();
                ddRoom.SelectedValue = meeting.RoomsId.ToString();

                //When we switch to the edit view, we are going to disable the validation for the times fields if the course
                //is an inet tnet tele courses.
                //Durring the actual update process, we also check the value so we do not attempt to parse a empty datetime entry
                if (!room.CheckIsBrickAndMortar(ddRoom.SelectedItem.Text))
                {
                    btnUpdateMeeting.ValidationGroup = "";
                }
                else
                {
                    btnUpdateMeeting.ValidationGroup = "editmeeting";
                }

                foreach (ListItem item in cblDays.Items)
                {
                    item.Selected = meeting.MeetDays.ToLower().Contains(item.Value.ToLower());
                }

                if (meeting.MeetStartTime > DateTime.MinValue)
                {
                    txtStartTime.Text = meeting.MeetStartTime.ToShortTimeString();
                }
                else
                {
                    txtStartTime.Text = "";
                }

                if (meeting.MeetEndTime > DateTime.MinValue)
                {
                    txtEndTime.Text = meeting.MeetEndTime.ToShortTimeString();
                }
                else
                {
                    txtEndTime.Text = "";
                }
            }
            if (e.CommandName == "deletemeeting")
            {
                log.SectionsId  = int.Parse(Request["SectionsID"]);
                log.SubmittedBy = Session["deltaid"].ToString();
                log.Change      = e.CommandArgument.ToString();
                log.AddRecord();

                Helpers.RefreshSortPending((GridView)Helpers.FindControlRecursive(Page.Master, "gvPendingChanges")); //Refresh the pending list
            }
        }
Пример #6
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                var fgResponseCode    = 0;
                var validationMessage = validateInput();

                if (validationMessage == string.Empty)
                {
                    if (MessageBox.Show("Are you sure you want to save", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (!_clsGeneralLibrary.tempPatch)
                        {
                            var      data      = new Dictionary <string, string>();
                            ClsRooms _clsRooms = new ClsRooms();
                            data.Add(_clsRooms.roomNumber, txtRoomNumber.Text);
                            data.Add(_clsRooms.floorNumber, txtFloorNumber.Text);
                            data.Add(_clsRooms.maxAdults, txtMaxAdult.Text);
                            data.Add(_clsRooms.maxChildren, txtMaxChildren.Text);
                            data.Add(_clsRooms.pricePerNight, txtPricePerNight.Text);
                            data.Add(_clsRooms.roomType, cmbRoomType.SelectedValue.ToString());
                            int active = 0;
                            if (cmbActive.Text.Trim().Equals("Yes"))
                            {
                                active = 1;
                            }
                            else
                            {
                                active = 0;
                            }

                            data.Add(_clsRooms.active, active.ToString());

                            fgResponseCode = _clsRestService.PostRequest(_clsGlobalConstants.rooms, data);
                            if (fgResponseCode != 0)
                            {
                                MessageBox.Show("Operation sucessfully completed....!!!!", "Sucess", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                            {
                                MessageBox.Show(_clsRestService.globalResponseMessage.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                            clearData();
                            fillRooms();
                        }
                        else
                        {
                            string  userId = string.Empty, roomNumber = string.Empty, floorNumber = string.Empty, active = string.Empty;
                            int     maxAdult = 0, maxChildren = 0, roomTypeId = 0;
                            decimal price = 0;

                            if (cmbActive.Text.Trim().Equals("Yes"))
                            {
                                active = "Y";
                            }
                            else
                            {
                                active = "N";
                            }
                            userId      = _clsGlobalConstants.glvUserId;
                            roomNumber  = txtRoomNumber.Text;
                            floorNumber = txtFloorNumber.Text;
                            maxAdult    = Convert.ToInt32(txtMaxAdult.Text);
                            maxChildren = Convert.ToInt32(txtMaxChildren.Text);
                            roomTypeId  = Convert.ToInt32(cmbRoomType.SelectedValue.ToString());
                            price       = Convert.ToDecimal(txtPricePerNight.Text);
                            _message    = _clsCommonServices.setRoomMaster(userId,
                                                                           roomNumber,
                                                                           floorNumber,
                                                                           maxAdult,
                                                                           maxChildren,
                                                                           price,
                                                                           roomTypeId,
                                                                           active);
                            if (!_message.Equals("No Error"))
                            {
                                MessageBox.Show(_message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                            else
                            {
                                MessageBox.Show("Operation sucessfully completed....!!!!", "Sucess", MessageBoxButtons.OK, MessageBoxIcon.Information);

                                fillRooms();
                            }
                            clearData();
                        }
                    }
                }
                else
                {
                    MessageBox.Show(validationMessage.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }