コード例 #1
0
        private static void ExtractOwner(string line)
        {
            string name = line.Substring(5, line.Length - 5).Trim();

            if (!string.IsNullOrEmpty(name))
            {
                EntityFinancialDecorator user = new EntityFinancialDecorator();
                //user.FirstName = new Droid.People.FirstName(name.Split(' ')[1]);
                user.Name = name.Split(' ')[0];
                _extractedActivity.Entities.Add(user);
            }
        }
コード例 #2
0
 private void DGVAddRefund(Refund r)
 {
     _dataGridViewRefund.Rows.Add();
     using (var row = _dataGridViewRefund.Rows[_dataGridViewRefund.Rows.Count - 1])
     {
         row.Cells[ColumnRfdAmount.Index].Value             = String.Format("{0:0.00}", r.Amount);
         row.Cells[ColumnRfdCurrency.Index].Value           = _intFnc.CurrentActivity.CurrencyUsed;
         row.Cells[ColumnRfdCurrencyPict.Index].Value       = GetCurrencyImage(_intFnc.CurrentActivity.CurrencyUsed);
         row.Cells[ColumnRfdUserGiver.Index].Value          = EntityFinancialDecorator.GetUser(_intFnc.CurrentActivity.Entities, r.Giver).GetName();
         row.Cells[ColumnRfdAvatar.Index].Value             = ResourceIconSet16Default.error;
         row.Cells[ColumnRfdUserReceiver.Index].Value       = EntityFinancialDecorator.GetUser(_intFnc.CurrentActivity.Entities, r.Receiver).GetName();
         row.Cells[ColumnRfdExchangeDone.Index].Value       = ResourceIconSet16Default.coins_in_hand;
         row.Cells[ColumnRfdExchangeDone.Index].ToolTipText = "This exchange is completed.";
         row.Cells[ColumnRfdGift.Index].Value           = ResourceIconSet16Default.gift_add;
         row.Cells[ColumnRfdGift.Index].ToolTipText     = "No refund, the receiver make a gift.";
         row.Cells[ColumnRfdCanceled.Index].Value       = ResourceIconSet16Default.door_out;
         row.Cells[ColumnRfdCanceled.Index].ToolTipText = "This exchange will never be done. \r\nAmount will be paid by other participants.";
         row.Cells[ColumnRfdStatus.Index].Value         = r.CurrentStatus;
         row.Cells[ColumnRfdId.Index].Value             = r.ID;
     }
 }
コード例 #3
0
        private void SaveExpense(bool newExps)
        {
            if (_expsCurrent != null)
            {
                if (newExps)
                {
                    UpdateAmount(_expsNew);
                    _expsNew.BillPath       = textBoxBillPath.Text;
                    _expsNew.Currency       = comboBoxCurrency.Text;
                    _expsNew.Name           = textBoxMovementName.Text;
                    _expsNew.Description    = textBoxDescription.Text;
                    _expsNew.AllParticipant = checkBoxAllRegardingParticipants.Checked;

                    //_expsNew.UserId.Clear();
                    //foreach (string item in comboBoxWho.Text.Split(','))
                    //    if (!string.IsNullOrEmpty(item))
                    //    {
                    //        User u = _intFnc.CurrentProject.GetUser(item.Trim());
                    //        if (u != null) _expsNew.UserId.Add(u.ID);
                    //    }
                    _expsNew.Movements.Clear();
                    foreach (string item in comboBoxParticipantList.Text.Split(','))
                    {
                        if (!string.IsNullOrEmpty(item))
                        {
                            EntityFinancialDecorator u = _intFnc.CurrentActivity.GetEntityProfile(item.Trim());
                            if (u != null)
                            {
                                _expsNew.Movements.Add(new Movement()
                                {
                                    UserId = new List <string>()
                                    {
                                        u.Id
                                    }, Amount = 0, StartDate = DateTime.Now
                                });
                            }
                        }
                    }

                    _expsNew.StartDate = dateTimePickerStartDate.Value;
                    _expsNew.EndDate   = dateTimePickerEndDate.Value;

                    if (radioButtonActivities.Checked)
                    {
                        _expsNew.Gop = CRE.GOP.ACTIVITIES;
                    }
                    else if (radioButtonComodities.Checked)
                    {
                        _expsNew.Gop = CRE.GOP.COMODITIES;
                    }
                    else if (radioButtonFood.Checked)
                    {
                        _expsNew.Gop = CRE.GOP.FOOD;
                    }
                    else if (radioButtonOther.Checked)
                    {
                        _expsNew.Gop = CRE.GOP.OTHER;
                    }
                    else if (radioButtonTransport.Checked)
                    {
                        _expsNew.Gop = CRE.GOP.TRANSPORT;
                    }
                    else if (radioButtonAbonmnent.Checked)
                    {
                        _expsNew.Gop = CRE.GOP.ABONMENT;
                    }
                    else if (radioButtonLogement.Checked)
                    {
                        _expsNew.Gop = CRE.GOP.LOGEMENT;
                    }
                    else if (radioButtonLoan.Checked)
                    {
                        _expsNew.Gop = CRE.GOP.LOANS;
                    }
                    else if (radioButtonClothe.Checked)
                    {
                        _expsNew.Gop = CRE.GOP.CLOTHES;
                    }
                }
                else
                {
                    UpdateAmount(_expsCurrent);
                    _expsCurrent.BillPath       = textBoxBillPath.Text;
                    _expsCurrent.Currency       = comboBoxCurrency.Text;
                    _expsCurrent.Name           = comboBoxMovement.Text;
                    _expsCurrent.Description    = textBoxDescription.Text;
                    _expsCurrent.StartDate      = dateTimePickerStartDate.Value;
                    _expsCurrent.EndDate        = dateTimePickerEndDate.Value;
                    _expsCurrent.IsPartial      = checkBoxIsPartial.Checked;
                    _expsCurrent.AllParticipant = checkBoxAllRegardingParticipants.Checked;

                    //_expsCurrent.UserId.Clear();
                    //foreach (string item in comboBoxWho.Text.Split(','))
                    //    if (!string.IsNullOrEmpty(item))
                    //    {
                    //        User u = _intFnc.CurrentProject.GetUser(item.Trim());
                    //        if (u != null) _expsCurrent.UserId.Add(u.ID);
                    //    }
                    _expsCurrent.Movements.Clear();
                    foreach (string item in comboBoxParticipantList.Text.Split(','))
                    {
                        if (!string.IsNullOrEmpty(item))
                        {
                            EntityFinancialDecorator u = _intFnc.CurrentActivity.GetEntityProfile(item.Trim());
                            if (u != null)
                            {
                                _expsCurrent.Movements.Add(new Movement()
                                {
                                    UserId = new List <string>()
                                    {
                                        u.Id
                                    }, Amount = 0, StartDate = DateTime.Now
                                });
                            }
                        }
                    }

                    if (radioButtonActivities.Checked)
                    {
                        _expsCurrent.Gop = CRE.GOP.ACTIVITIES;
                    }
                    else if (radioButtonComodities.Checked)
                    {
                        _expsCurrent.Gop = CRE.GOP.COMODITIES;
                    }
                    else if (radioButtonFood.Checked)
                    {
                        _expsCurrent.Gop = CRE.GOP.FOOD;
                    }
                    else if (radioButtonOther.Checked)
                    {
                        _expsCurrent.Gop = CRE.GOP.OTHER;
                    }
                    else if (radioButtonTransport.Checked)
                    {
                        _expsCurrent.Gop = CRE.GOP.TRANSPORT;
                    }
                    else if (radioButtonAbonmnent.Checked)
                    {
                        _expsCurrent.Gop = CRE.GOP.ABONMENT;
                    }
                    else if (radioButtonLogement.Checked)
                    {
                        _expsCurrent.Gop = CRE.GOP.LOGEMENT;
                    }
                    else if (radioButtonLoan.Checked)
                    {
                        _expsCurrent.Gop = CRE.GOP.LOANS;
                    }
                    else if (radioButtonClothe.Checked)
                    {
                        _expsCurrent.Gop = CRE.GOP.CLOTHES;
                    }
                }
            }
        }