예제 #1
0
        private Employees GetObject()
        {
            Employees employee = new Employees();

            employee.EmployeeId     = (this.IsUpdate)?this.EmployeeId:(Convert.ToInt32(EmployeeIdTextBox.Text.Trim()));
            employee.FullName       = FullNameTextBox.Text.Trim();
            employee.DateOfBirth    = DOBdateTimePicker.Value.Date;
            employee.NICNumber      = NICTextBox.Text.Trim();
            employee.EmailAddress   = EmailAddressTextBox.Text.Trim();
            employee.Mobile         = MobileTextBox.Text.Trim();
            employee.Telephone      = TelephoneTextBox.Text.Trim();
            employee.GenderId       = (GenderComboBox.SelectedIndex == -1) ? 0 : Convert.ToInt32(GenderComboBox.SelectedValue);
            employee.BranchId       = (BranchComboBox.SelectedIndex == -1) ? 0 : Convert.ToInt32(BranchComboBox.SelectedValue);
            employee.EmploymentDate = EmploymentDatedateTimePicker.Value.Date;
            employee.Photo          = (EmployeePictureBox.Image == null) ? null : ImageManipulation.GetPhoto(EmployeePictureBox);
            employee.AddressLine    = AddressLineTextBox.Text.Trim();
            employee.CityId         = (CityComboBox.SelectedIndex == -1) ? 0 : Convert.ToInt32(CityComboBox.SelectedValue);
            employee.DistrictId     = (DistrictComboBox.SelectedIndex == -1) ? 0 : Convert.ToInt32(DistrictComboBox.SelectedValue);
            employee.PostCode       = PostCodeTextBox.Text.Trim();
            employee.JObTitleId     = (JobTitleComboBox.SelectedIndex == -1) ? 0 : Convert.ToInt32(JobTitleComboBox.SelectedValue);
            employee.CurrentSalary  = Convert.ToDecimal(CurrentSalaryTextBox1.Text);
            employee.StartingSalary = Convert.ToDecimal(StartingSalaryTextBox.Text);
            employee.HasLeft        = (HasLeftComboBox.Text == "Yes") ? true : false;
            employee.DateLeft       = DateLeftDateTimePicker.Value.Date;
            employee.ReasonLeftId   = (ReasonLeftComboBox.SelectedIndex == -1) ? 0 : Convert.ToInt32(ReasonLeftComboBox.SelectedValue);
            employee.Comments       = CommentsTextBox.Text.Trim();
            employee.CreatedBy      = LoggedInUsers.UserName;


            return(employee);
        }
예제 #2
0
        private Branch GetObject()
        {
            Branch branch = new Branch();

            branch.BranchId    = (this.IsUpdate) ? this.BranchId : 0;
            branch.BranchName  = BranchNametextBox.Text;
            branch.Email       = EmailAddressTextBox.Text;
            branch.Telephone   = TelephoneTextBox.Text;
            branch.Website     = WebsiteTextBox.Text;
            branch.AddressLine = AddressLineTextBox.Text;
            branch.CityId      = Convert.ToInt32(CityNameComboBox.SelectedValue);
            branch.DistrictId  = Convert.ToInt32(DistrictNameComboBox.SelectedValue);
            branch.PostCode    = PostCodeTextBox.Text;
            branch.BranchImage = (LogoPictureBox.Image == null)? null:ImageManipulation.GetPhoto(LogoPictureBox);
            branch.CreatedBy   = LoggedInUsers.UserName;

            return(branch);
        }
예제 #3
0
        private object GetObject()
        {
            Students s = new Students();

            s.StudentId     = (this.IsUpdate)?this.StudentId:(Convert.ToInt32(StudentIdTextBox.Text.Trim()));
            s.FullName      = FullNameTextBox.Text.Trim();
            s.FatherName    = FatherNameTextBox.Text.Trim();
            s.MotherName    = MotherNameTextBox.Text.Trim();
            s.DOB           = DOBDateTimePicker.Value.Date;
            s.Address       = AddressTextBox.Text.Trim();
            s.Email         = EmailTextBox.Text.Trim();
            s.AdmissionDate = AdmissionDateDateTimePicker.Value.Date;
            s.Mobile        = MobileTextBox.Text.Trim();
            s.BloodGroup    = BloodGroupTextBox.Text.Trim();
            s.GenderId      = (GenderComboBox.SelectedIndex == -1) ? 0 : Convert.ToInt32(GenderComboBox.SelectedValue);
            s.BranchId      = (BranchComboBox.SelectedIndex == -1) ? 0 : Convert.ToInt32(BranchComboBox.SelectedValue);
            s.Photo         = (ImagepictureBox.Image == null) ? null : ImageManipulation.GetPhoto(ImagepictureBox);
            s.CreatedBy     = LoggedInUsers.UserName;
            return(s);
        }