Пример #1
0
        private void AddProduct()
        {
            if (string.IsNullOrEmpty(_newItem.ProductCode))
            {
                MessageWindow.ShowAlertMessage("Product Code is required");
                return;
            }

            if (ProductImage.WhereProductCodeIs(_newItem.ProductCode) != null)
            {
                MessageWindow.ShowAlertMessage("Product Code already exists");
                return;
            }

            var result = _newItem.Create();

            if (!result.Success)
            {
                MessageWindow.ShowAlertMessage(result.Message);
                return;
            }

            // success
            DialogResult = true;
            Close();
        }
Пример #2
0
        public void SetPropertiesFromDataRow(DataRow dataRow)
        {
            ID                    = (int)dataRow["ID"];
            Name                  = (string)dataRow["Name"];
            LoanType              = (string)dataRow["LoanType"];
            ModeOfPayment         = (string)dataRow["ModeOfPayment"];
            AnnualInterestRate    = (decimal)dataRow["AnnualInterestRate"];
            ProductCode           = DataConverter.ToString(dataRow["ProductCode"]);
            MinimumTerm           = DataConverter.ToInteger(dataRow["MinimumTerm"]);
            MaximumTerm           = DataConverter.ToInteger(dataRow["MaximumTerm"]);
            MinimumLoanableAmount = DataConverter.ToDecimal(dataRow["MinimumLoanableAmount"]);
            MaximumLoanableAmount = DataConverter.ToDecimal(dataRow["MaximumLoanableAmount"]);
            MonthlyCapitalBuildUp = DataConverter.ToDecimal(dataRow["MonthlyCapitalBuildUp"]);

            LoanCharges = LoanCharge.GetListByLoanProductId(ID);

            Description = string.Format("Loanable amount of P{0:N} - P{1:N}", MinimumLoanableAmount,
                                        MaximumLoanableAmount);

            var productImage = ProductImage.WhereProductCodeIs(ProductCode);

            if (null == productImage)
            {
                return;
            }

            BitmapImage = productImage.BitmapImage;
        }