public static Profit_ExpenceDAL WPF_to_DAL(Profit_ExpenceWPF_DTO profit_ExpanceWPF)
        {
            Profit_ExpenceDAL profit_ExpanceDAL = new Profit_ExpenceDAL()
            {
                Date_               = profit_ExpanceWPF.Date_,
                Sum                 = profit_ExpanceWPF.Sum,
                Description         = profit_ExpanceWPF.Description,
                Profit_Expance_Type = profit_ExpanceWPF.Profit_Expance_Type
            };

            return(profit_ExpanceDAL);
        }
        public static Profit_ExpenceWPF_DTO DAL_to_WPF(Profit_ExpenceDAL profit_ExpanceDAL)
        {
            Profit_ExpenceWPF_DTO profit_ExpanceWPF = new Profit_ExpenceWPF_DTO()
            {
                Date_               = profit_ExpanceDAL.Date_,
                Sum                 = profit_ExpanceDAL.Sum,
                Description         = profit_ExpanceDAL.Description,
                Profit_Expance_Type = profit_ExpanceDAL.Profit_Expance_Type
            };

            return(profit_ExpanceWPF);
        }
Пример #3
0
 private void Save_New_Plan_Click(object sender, RoutedEventArgs e)
 {
     if (type.Text != null && description.Text != null)
     {
         if (Decimal.TryParse(sum.Text, System.Globalization.NumberStyles.AllowCurrencySymbol, CultureInfo.CreateSpecificCulture("uk-UA"), out decimal number) == true)
         {
             Profit_ExpenceWPF_DTO new_plan = new Profit_ExpenceWPF_DTO()
             {
                 Date_ = date_plan.SelectedDate.Value,
                 Sum   = number,
                 Profit_Expance_Type = type.Text.ToString(),
                 Description         = description.Text
             };
             _dalCl.Save_New_Plan(Converter_Profit_Expence.WPF_to_DAL(new_plan), type.Text.ToString(), CurrentUser.Login);
             sum.Text         = "";
             description.Text = "";
         }
     }
 }