예제 #1
0
        public AddFollowUpViewModel(IEnumerable <EnquiryModel> enquiries, FollowUpModel followUpModel)
        {
            Enquiries = enquiries.OrderBy(x => x.EventType.Name).ThenByDescending(x => x.CreationDate).ToList();

            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _crmDataUnit = dataUnitLocator.ResolveDataUnit <ICrmDataUnit>();

            CanEditEveryoneFollowUps = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_EVERYONE_FOLLOWUP_ALLOWED);
            CanEditOwnFollowUps      = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_OWN_FOLLOWUP_ALLOWED);
            IsFromCRM = true;

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            OpenEnquiryCommand = new RelayCommand(OpenEnquiryCommandExecute, OpenEnquiryCommandCanExecute);

            if (followUpModel != null)
            {
                ProcessFollowUp(followUpModel);
                SelectedEnquiry  = Enquiries.FirstOrDefault(x => x.Enquiry == followUpModel.FollowUp.Enquiry);
                _originalEnquiry = SelectedEnquiry.Clone();
            }
            else
            {
                FollowUp = GetFollowUpWithoutEnquiry();
                FollowUp.PropertyChanged += FollowUpOnPropertyChanged;
            }
        }
예제 #2
0
        /// <summary>
        /// Loads Users Details
        /// </summary>
        private void LoadEnquiryDetails()
        {
            dtEnquries   = new DataTable();
            _objEnquries = new Enquiries();

            dgEnquiries.DataSource         = dtEnquries = _objEnquries.LoadEnquries();
            dgEnquiries.Columns[0].Visible = false;
        }
예제 #3
0
        private void btnEnquiry_Click(object sender, EventArgs e)
        {
            int queryResult = -1;

            if (!string.IsNullOrWhiteSpace(txtBxTechnology.Text) &&
                !string.IsNullOrWhiteSpace(txtBxStudentName.Text) &&
                !string.IsNullOrWhiteSpace(txtBxStudentFee.Text) &&
                !string.IsNullOrWhiteSpace(txtBxSMobileNo.Text) &&
                !string.IsNullOrWhiteSpace(txtBxSEmail.Text) &&
                !string.IsNullOrWhiteSpace(txtBxTrainerEmail.Text) &&
                !string.IsNullOrWhiteSpace(txtBxTrainerFee.Text) &&
                !string.IsNullOrWhiteSpace(txtBxTrainerMobileNo.Text) &&
                cmBxTrainers.SelectedIndex > 0 &&
                cmBxStatus.SelectedIndex > 0 &&
                cmbTraineeTypes.SelectedIndex > 0
                )
            {
                _objEnquries = new Enquiries();

                _objEnquries.Technology    = txtBxTechnology.Text;
                _objEnquries.StudentEmail  = txtBxSEmail.Text;
                _objEnquries.StudentFee    = Convert.ToDecimal(txtBxStudentFee.Text);
                _objEnquries.StudentMobile = Convert.ToInt64(txtBxSMobileNo.Text);
                _objEnquries.StudentName   = txtBxStudentName.Text;

                _objEnquries.TrainerEmail   = txtBxTrainerEmail.Text;
                _objEnquries.TrainerFee     = Convert.ToDecimal(txtBxTrainerFee.Text);
                _objEnquries.TrainerMobile  = Convert.ToInt64(txtBxTrainerMobileNo.Text);
                _objEnquries.TrainerName    = cmBxTrainers.Text;
                _objEnquries.TraineeTypeId  = Convert.ToInt32(cmbTraineeTypes.SelectedValue);
                _objEnquries.EnquiryStatus  = cmBxStatus.Text;
                _objEnquries.Remarks        = txtBxRemarks.Text;
                _objEnquries.LastModifiedBy = LoginSuccessDetails.UID;

                _objEnquries.StudentReferredBy = txtStudentReferredBy.Text;
                _objEnquries.TrainerReferredBy = txtTrainerReferredBy.Text;

                if (btnEnquiry.Text.ToUpper().Contains("ADD"))
                {
                    queryResult = _objEnquries.CreateEnquiry(_objEnquries);
                }
                else
                {
                    _objEnquries.EID = Convert.ToInt32(dgEnquiries.CurrentRow.Cells["EID"].Value.ToString());
                    queryResult      = _objEnquries.UpdateEnquiry(_objEnquries);
                }

                if (queryResult > 0)
                {
                    LoadEnquiryDetails();
                    ClearAllControls();
                }
            }
            else
            {
                MessageBox.Show("Please enter missed fields", "Enquiry Form", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
예제 #4
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Do you want to delete this enquiry Details : " + dgEnquiries.CurrentRow.Cells["EID"].Value.ToString(), "User Creation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         _objEnquries = new Enquiries();
         int queryResult = _objEnquries.DeleteEnquiry(Convert.ToInt32(dgEnquiries.CurrentRow.Cells["EID"].Value.ToString()));
         if (queryResult > 0)
         {
             LoadEnquiryDetails();
             ClearAllControls();
         }
     }
 }
예제 #5
0
 public string Insert(Enquiries enquiries)
 {
     return(null);
 }