Пример #1
0
        private void SaveGurantorForm()
        {
            //Co Applicant or Gurantor
            GurantorTypeModel gurantorTypeModel = (GurantorTypeModel)GurantorComboBox.SelectedItem;

            model.gurantorModel.gurantortype_id = gurantorTypeModel.gurantortype_id;

            //First, Middle and Last Name
            model.gurantorModel.gurantor_firstname = FirstNameApplicantTextBox.Text;
            if (MiddleNameApplicantTextBox.Text.Length != 0)
            {
                model.gurantorModel.gurantor_middlename = MiddleNameApplicantTextBox.Text;
            }
            else
            {
                model.gurantorModel.gurantor_middlename = "";
            }
            model.gurantorModel.gurantor_lastname = LastNameApplicantTextBox.Text;

            //Mobile
            model.gurantorModel.gurantor_mobile = MobilNumberApplicantTextBox.Text;

            //Relationship
            model.gurantorModel.gurantor_relation = RelationshipApplicantTextBox.Text;

            //Office Address
            model.gurantorModel.gurantor_currentaddress = OfficeAddressApplicantTextBlock.Text;
        }
Пример #2
0
 public void UpdateGurantorType(GurantorTypeModel model)
 {
     using (IDbConnection connection = new NpgsqlConnection(GlobalConfig.getDatabaseConnectionString()))
     {
         connection.ExecuteScalar($"update gurantortype set gurantortype_id = '{model.gurantortype_id}', gurantortype_name = '{model.gurantortype_name}'");
     }
 }
Пример #3
0
 public GurantorTypeModel CreateGurantorType(GurantorTypeModel model)
 {
     using (IDbConnection connection = new NpgsqlConnection(GlobalConfig.getDatabaseConnectionString()))
     {
         int id = connection.ExecuteScalar <int>($"insert into gurantortype values(default,'{model.gurantortype_id}','{model.gurantortype_name}')");
         return(model);
     }
 }
        private void WireUpForm()
        {
            //Co Applicant or Gurantor
            if (GurantorComboBox.SelectedItem != null)
            {
                GurantorTypeModel gurantorTypeModel = (GurantorTypeModel)GurantorComboBox.SelectedItem;
                model.gurantorModel.gurantortype_id = gurantorTypeModel.gurantortype_id;
            }

            //First, Middle and Last Name
            if (FirstNameTextBox.Text.Length != 0)
            {
                model.gurantorModel.gurantor_firstname = FirstNameTextBox.Text;
            }
            if (MiddleNameTextBox.Text.Length != 0)
            {
                model.gurantorModel.gurantor_middlename = MiddleNameTextBox.Text;
            }
            else
            {
                model.gurantorModel.gurantor_middlename = "";
            }
            if (LastNameTextBox.Text.Length != 0)
            {
                model.gurantorModel.gurantor_lastname = LastNameTextBox.Text;
            }

            //Mobile
            if (MobilNumberTextBox.Text.Length != 0)
            {
                model.gurantorModel.gurantor_mobile = MobilNumberTextBox.Text;
            }

            //Relationship
            if (RelationshipTextBox.Text.Length != 0)
            {
                model.gurantorModel.gurantor_relation = RelationshipTextBox.Text;
            }

            //Office Address
            if (OfficeAddressTextBlock.Text.Length != 0)
            {
                model.gurantorModel.gurantor_currentaddress = OfficeAddressTextBlock.Text;
            }
        }