Example #1
0
 private void listViewLoanCycles_Click(object sender, EventArgs e)
 {
     try
     {
         buttonRemoveAmountCycles.Enabled = false;
         if (cbxCycleObjects.SelectedItem == null) return;
         buttonRemoveAmountCycles.Enabled = true;
         textBoxCycleMin.TextChanged -= textBoxCycleMin_TextChanged;
         textBoxCycleMax.TextChanged -= textBoxCycleMax_TextChanged;
         switch (((CycleObject)cbxCycleObjects.SelectedItem).Id)
         {
             case 1:
                 _editedParam = (LoanAmountCycle)listViewLoanCycles.SelectedItems[0].Tag;
                 textBoxCycleMin.Text = _editedParam.Min.Value.ToString("0");
                 textBoxCycleMax.Text = _editedParam.Max.Value.ToString("0");
                 textBoxCycleMin.Enabled = true;
                 textBoxCycleMax.Enabled = true;
                 break;
             case 2:
                 _editedParam = (RateCycle)listViewLoanCycles.SelectedItems[0].Tag;
                 textBoxCycleMin.Text = _editedParam.Min.Value.ToString("0.00");
                 textBoxCycleMax.Text = _editedParam.Max.Value.ToString("0.00");
                 textBoxCycleMin.Enabled = true;
                 textBoxCycleMax.Enabled = true;
                 break;
             case 3:
                 _editedParam = (MaturityCycle)listViewLoanCycles.SelectedItems[0].Tag;
                 textBoxCycleMin.Text = _editedParam.Min.Value.ToString("0");
                 textBoxCycleMax.Text = _editedParam.Max.Value.ToString("0");
                 textBoxCycleMin.Enabled = true;
                 textBoxCycleMax.Enabled = true;
                 break;
             default: break;
         }
     }
     catch { }
     finally
     {
         textBoxCycleMin.TextChanged += textBoxCycleMin_TextChanged;
         textBoxCycleMax.TextChanged += textBoxCycleMax_TextChanged;
     }
 }
 private void SetCommand(OpenCbsCommand c, Cycle cycle)
 {
     c.AddParam("@loan_cycle", cycle.LoanCycle);
     c.AddParam("@min", cycle.Min.Value);
     c.AddParam("@max", cycle.Max.Value);
     c.AddParam("@cycle_object_id", cycle.CycleObjectId);
     c.AddParam("@cycle_id", cycle.CycleId);
 }