Exemple #1
0
        private void fmScholarship_Load(object sender, EventArgs e)
        {
            IScholarshipService sService = new ScholarshipService();

            colFee               = new GridViewComboBoxColumn("Fee");
            colFee.HeaderText    = "Fee";
            colFee.FieldName     = "FeeID";
            colFee.ValueMember   = "FeeID";
            colFee.DisplayMember = "FeeDescription";
            colFee.Width         = 180;


            gvScholarshipDetails.Columns.Add(colFee);

            if (Op.Equals("edit"))
            {
                SetField();
                SetScholarshipDiscountGrid();
            }

            if (Op.Equals("new"))
            {
                BindScholarshipDiscountGrid();
                gvScholarshipDetails.Enabled = false;
            }
        }
Exemple #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (Op.Equals("edit"))
     {
         if (String.IsNullOrEmpty(txtUsername.Text) || String.IsNullOrEmpty(txtFirstName.Text) ||
             String.IsNullOrEmpty(txtLastName.Text) || String.IsNullOrEmpty(txtOldPWD.Text))
         {
             MessageBox.Show("Please fill up all important(*) fields");
             return;
         }
         else
         {
             SaveUser();
         }
     }
     else
     {
         if (String.IsNullOrEmpty(txtUsername.Text) || String.IsNullOrEmpty(txtFirstName.Text) ||
             String.IsNullOrEmpty(txtLastName.Text) || String.IsNullOrEmpty(txtPassword.Text) ||
             String.IsNullOrEmpty(txtRetypePWD.Text))
         {
             MessageBox.Show("Please fill up all important(*) fields");
             return;
         }
         else
         {
             SaveUser();
         }
     }
 }
        private void Save()
        {
            Boolean    ret;
            string     message = String.Empty;
            Curriculum c       = new Curriculum();

            if (chkCurrent.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
            {
                c.CurrentCurr = true;
            }

            c.CurriculumCode     = txtCurrCode.Text;
            c.CurriculumSubjects = currSub1.ToArray();
            c.Description        = txtDescription.Text;
            if (Op.Equals("edit"))
            {
                ret = cs.UpdateCurriculum(ref c, ref message);
            }
            else
            {
                ret = cs.CreateCurriculum(ref c, ref message);
            }

            if (ret)
            {
                MessageBox.Show(this, message, "Add Successful");
            }
            else
            {
                MessageBox.Show(this, message, "Add Failed");
            }
        }
 public string getOperand(string t, string textBox)
 {
     // Apply changes as per the accepted answer
     textBox = textBox + t;
     if (t.Equals(","))
     {
         Change = true;
         Second = double.Parse(textBox);
     }
     else if (Op.Equals(""))
     {
         if (!Change)
         {
             textBox = "";
             Change  = true;
             textBox = textBox + t;
         }
         First = double.Parse(textBox);
     }
     else
     {
         if (!Change)
         {
             textBox = "";
             Change  = true;
             textBox = textBox + t;
         }
         Second = double.Parse(textBox);
     }
     return(textBox);
 }
        private void Save()
        {
            BuildingServiceClient buildingService = new BuildingServiceClient();
            Boolean  ret      = false;
            string   message  = String.Empty;
            Building building = new Building()
            {
                BuildingCode = txtBuildingCode.Text.ToString(),
                Description  = txtDescription.Text.ToString(),
                BuildingName = txtName.Text.ToString(),
                Rooms        = rooms.ToArray()
            };

            if (Op.Equals("edit"))
            {
                ret = buildingService.UpdateBuilding(ref building, ref message);
            }
            else
            {
                ret = buildingService.CreateBuilding(ref building, ref message);
            }

            if (ret)
            {
                MessageBox.Show("Saved Successfully");
            }
            else
            {
                MessageBox.Show("Error Saving");
            }

            Close();
        }
        /// <summary>
        ///     Returns true if ResponseMessage instances are equal
        /// </summary>
        /// <param name="other">Instance of ResponseMessage to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ResponseMessage other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
            {
                return(false);
            }

            return((Op == other.Op || Op != null && Op.Equals(other.Op)) && (Id == other.Id || Id != null && Id.Equals(other.Id)));
        }
        private void frmCurriculumDetails_Load(object sender, EventArgs e)
        {
            if (Op.Equals("edit"))
            {
                SetFields();
            }
            if (Op.Equals("new"))
            {
                // BindSubjectGrid();
                radGroupBox2.Visible = false;
                this.Size            = new Size(851, 211);
            }

            subDetails = new List <SubjectsDetails>();
            currSub    = new List <CurriculumSubject>(cs.GetAllSubjectDetails());
            foreach (CurriculumSubject cs in currSub)
            {
                SubjectsDetails sd = new SubjectsDetails();
                sd.Academic           = cs.Academic;
                sd.CurrDescription    = cs.CurrDescription;
                sd.CurrentCurr        = cs.CurrentCurr;
                sd.CurriculumCode     = cs.CurriculumCode;
                sd.CurrSubCode        = cs.CurrSubCode;
                sd.Deactivated        = cs.Deactivated;
                sd.GradeLevel         = cs.GradeLevel;
                sd.LearningAreaCode   = cs.LearningAreaCode;
                sd.RatePerUnit        = cs.RatePerUnit;
                sd.Subj               = cs.Subj;
                sd.SubjectCode        = cs.SubjectCode;
                sd.SubjectDescription = cs.SubjectDescription;
                sd.Units              = cs.Units;


                if (currSub1 != null)
                {
                    List <CurriculumSubject> matches = currSub1.Where(p => p.SubjectCode == cs.SubjectCode).ToList <CurriculumSubject>();
                    if (matches.Count > 0)
                    {
                        sd.Added = true;
                    }
                    else
                    {
                        sd.Added = false;
                    }
                }
                else
                {
                    sd.Added = false;
                }


                subDetails.Add(sd);
            }
            gvSubjects.DataSource = subDetails;
        }
        private void frmScholarshipDiscount_Load(object sender, EventArgs e)
        {
            if (Op.Equals("newScholarshipDiscount"))
            {
                txtCode.Text    = scholarshipCode.ToString();
                txtCode.Enabled = false;

                IScholarshipService fSC = new ScholarshipService();
                cmbFee.ValueMember   = "FeeID";
                cmbFee.DisplayMember = "FeeDescription";
            }
        }
        private void frmCurriculumDetails_Load(object sender, EventArgs e)
        {
            InitializeGradeLevel();
            if (Op.Equals("edit"))
            {
                SetFields();
            }

            subDetails = new List <SubjectsDetails>();
            currSub    = new List <CurriculumSubject>(cs.GetAllSubjectDetails());
            foreach (CurriculumSubject cs in currSub)
            {
                SubjectsDetails sd = new SubjectsDetails();
                sd.Academic           = cs.Academic;
                sd.CurrDescription    = cs.CurrDescription;
                sd.CurrentCurr        = cs.CurrentCurr;
                sd.CurriculumCode     = cs.CurriculumCode;
                sd.CurrSubCode        = cs.CurrSubCode;
                sd.Deactivated        = cs.Deactivated;
                sd.GradeLevel         = cs.GradeLevel;
                sd.LearningAreaCode   = cs.LearningAreaCode;
                sd.RatePerUnit        = cs.RatePerUnit;
                sd.Subj               = cs.Subj;
                sd.SubjectCode        = cs.SubjectCode;
                sd.SubjectDescription = cs.SubjectDescription;
                sd.Units              = cs.Units;
                if (cs.SubjectCode == "ENG1")
                {
                    Console.WriteLine("shoud be true HERE");
                }

                if (currSub1 != null)
                {
                    List <CurriculumSubject> matches = currSub1.Where(p => p.SubjectCode == cs.SubjectCode).ToList <CurriculumSubject>();
                    if (matches.Count > 0)
                    {
                        sd.Added = true;
                    }
                    else
                    {
                        sd.Added = false;
                    }
                }
                else
                {
                    sd.Added = false;
                }


                subDetails.Add(sd);
            }
            gvSubjects.DataSource = subDetails;
        }
 private void txtTimeslotCode_Leave(object sender, EventArgs e)
 {
     if (!Op.Equals("edit"))
     {
         if (timeslotList.Exists(x => x.TimeSlotCode == txtTimeslotCode.Text))
         {
             MessageBox.Show("Code already exists");
             txtTimeslotCode.Text = "";
             txtTimeslotCode.Focus();
         }
     }
 }
        private void frmBuildingDetails_Load(object sender, EventArgs e)
        {
            if (Op.Equals("edit"))
            {
                SetFields();
                SetRoomGrid();
            }

            if (Op.Equals("new"))
            {
                IBuildingService buildingService = new BuildingService();
                BindRoomGrid();
            }
        }
Exemple #12
0
        private void frmStudentDetails_Load(object sender, EventArgs e)
        {
            pvStudent.SelectedPage = pvStudent.Pages[0];

            if (Op.Equals("new"))
            {
                GenerateStudentID();
                txtAge.Text = calculateAge(dtDOB.Value).ToString();
            }

            if (Op.Equals("edit"))
            {
                SetFields();
            }
        }
        /// <summary>
        ///     Returns true if StatusMessage instances are equal
        /// </summary>
        /// <param name="other">Instance of StatusMessage to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(StatusMessage other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
            {
                return(false);
            }

            return((Op == other.Op || Op != null && Op.Equals(other.Op)) &&
                   (Id == other.Id || Id != null && Id.Equals(other.Id)) &&
                   (ErrorMessage == other.ErrorMessage || ErrorMessage != null && ErrorMessage.Equals(other.ErrorMessage)) &&
                   (ErrorCode == other.ErrorCode || ErrorCode != null && ErrorCode.Equals(other.ErrorCode)) &&
                   (ConnectionId == other.ConnectionId || ConnectionId != null && ConnectionId.Equals(other.ConnectionId)) &&
                   (ConnectionClosed == other.ConnectionClosed || ConnectionClosed != null && ConnectionClosed.Equals(other.ConnectionClosed)) &&
                   (StatusCode == other.StatusCode || StatusCode != null && StatusCode.Equals(other.StatusCode)));
        }
Exemple #14
0
        /// <summary>
        ///     Returns true if OrderSubscriptionMessage instances are equal
        /// </summary>
        /// <param name="other">Instance of OrderSubscriptionMessage to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrderSubscriptionMessage other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
            {
                return(false);
            }

            return((Op == other.Op || Op != null && Op.Equals(other.Op)) &&
                   (Id == other.Id || Id != null && Id.Equals(other.Id)) &&
                   (SegmentationEnabled == other.SegmentationEnabled || SegmentationEnabled != null && SegmentationEnabled.Equals(other.SegmentationEnabled)) &&
                   (OrderFilter == other.OrderFilter || OrderFilter != null && OrderFilter.Equals(other.OrderFilter)) &&
                   (Clk == other.Clk || Clk != null && Clk.Equals(other.Clk)) &&
                   (HeartbeatMs == other.HeartbeatMs || HeartbeatMs != null && HeartbeatMs.Equals(other.HeartbeatMs)) &&
                   (InitialClk == other.InitialClk || InitialClk != null && InitialClk.Equals(other.InitialClk)) &&
                   (ConflateMs == other.ConflateMs || ConflateMs != null && ConflateMs.Equals(other.ConflateMs)));
        }
Exemple #15
0
        private void Save()
        {
            IRegistrationService regService   = new RegistrationService();
            ITraitService        traitService = new TraitService();
            Boolean ret     = false;
            string  message = String.Empty;
            Trait   trait   = new Trait()
            {
                Description = txtDescription.Text.ToString(),
                CurrTrait   = chkCurrent.Checked,
                Category    = Int32.Parse(cmbCategory.SelectedValue.ToString())
            };

            if (ExistingTraits.Exists(t => t.Category == trait.Category && t.Description == trait.Description && t.CurrTrait == trait.CurrTrait))
            {
                MessageBox.Show(this, "Trait for that Category already Exists", "Trait Exists");
            }
            else
            {
                if (Op.Equals("edit"))
                {
                    trait.TraitsID = SelectedTrait.TraitsID;
                    ret            = traitService.UpdateTrait(ref trait, ref message);
                }
                else
                {
                    ret = traitService.CreateTrait(ref trait, ref message);
                    if (ret && trait.CurrTrait)
                    {
                        List <Trait> updatedTraits = new List <Trait>(traitService.GetAllTraits());
                        Trait        savedTrait    = new Trait();
                        savedTrait = updatedTraits.Find(t => t.Category == trait.Category && t.Description == trait.Description && t.CurrTrait == trait.CurrTrait);
                        ret        = regService.UpdateStudentCharacters(savedTrait);
                    }
                }

                if (ret)
                {
                    MessageBox.Show(this, "Saved Successfully");
                }
            }

            this.Close();
        }
        private void frmTimeSlotDetails_Load(object sender, EventArgs e)
        {
            string[] stringArray = new string[7];

            if (Op.Equals("edit"))
            {
                txtTimeslotCode.Enabled = false;
                txtTimeslotCode.Text    = SelectedTimeslot.TimeSlotCode;
                tPStart.Value           = DateTime.ParseExact(SelectedTimeslot.TimeStart, "hh:mm tt", System.Globalization.CultureInfo.CurrentCulture);
                tpEnd.Value             = DateTime.ParseExact(SelectedTimeslot.TimeEnd, "hh:mm tt", System.Globalization.CultureInfo.CurrentCulture);

                stringArray = SelectedTimeslot.Days.Split(',');

                chkSunday.Checked    = SelectedTimeslot.Days.Contains("Su");
                chkMonday.Checked    = SelectedTimeslot.Days.Contains("M");
                chkTuesday.Checked   = SelectedTimeslot.Days.Contains("Tu");
                chkWednesday.Checked = SelectedTimeslot.Days.Contains("W");
                chkThursday.Checked  = SelectedTimeslot.Days.Contains("Th");
                chkFriday.Checked    = SelectedTimeslot.Days.Contains("F");
                chkSaturday.Checked  = SelectedTimeslot.Days.Contains("S");
            }
        }
Exemple #17
0
        private void Save()
        {
            IScholarshipService sService = new ScholarshipService();
            Boolean             ret      = false;
            string message = String.Empty;
            ScholarshipDiscount scholarship = new ScholarshipDiscount();

            if (Op.Equals("edit"))
            {
                ret = sService.UpdateScholarship(ref scholarship, ref message);
            }
            else
            {
                ret = sService.CreateScholarship(ref scholarship, ref message);
            }

            if (ret)
            {
                MessageBox.Show("Saved Successfully");
            }
            else
            {
                MessageBox.Show("Error Saving");
            }

            if (Op.Equals("edit"))
            {
                Close();
            }
            if (Op.Equals("new"))
            {
                Op = "edit";
                txtScholarshipCode.Enabled   = false;
                gvScholarshipDetails.Enabled = true;
            }
            this.Close();
        }