Example #1
0
        private void SetProductRawMaterialData()
        {
            if (gridProductRawMaterials.SelectedRows.Count > 0)
            {
                // get id
                productRawMaterialID = int.Parse(gridProductRawMaterials.SelectedRows[0].Cells[0].Value.ToString());
                if (productRawMaterialID != 0)
                {
                    //show and hide controls
                    page.SetPage(pageUpdateProductRawMaterials);
                    lblAddEditTitle.Text = "Edit Record";
                    bunifuTransition1.HideSync(pnlSide, false, BunifuAnimatorNS.Animation.Transparent);

                    // populate data
                    var obj = Factories.CreateProduct().GetProductRawMaterial(productRawMaterialID);
                    cboSupplyClass.SelectedItem = LocalUtils.GetSelectedItemX(cboSupplyClass.Items, obj.SupplyClassID.ToString());
                    cboSupplyTypes.SelectedItem = LocalUtils.GetSelectedItemX(cboSupplyTypes.Items, obj.SupplyTypeID.ToString());
                    txtQuantity.Text            = obj.Quantity.ToString();
                }
                else
                {
                    LocalUtils.ShowNoRecordFoundMessage(this);
                }
            }
            else
            {
                LocalUtils.ShowNoRecordSelectedMessage(this);
            }
        }
Example #2
0
 private void SetData()
 {
     try
     {
         var model = Factories.CreateSupplyType().GetBy(supplyTypeID);
         txtDescription.Text         = model.Description;
         txtUnitPrice.Text           = model.UnitPrice.ToString();
         cboSupplyClass.SelectedItem = LocalUtils.GetSelectedItemX(cboSupplyClass.Items, model.SupplyClassID.ToString());
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #3
0
        private void SetProductionData()
        {
            try
            {
                if (gridProductionList.SelectedRows.Count > 0)
                {
                    // get id
                    productionID = int.Parse(gridProductionList.SelectedRows[0].Cells[0].Value.ToString());
                    if (productionID != 0)
                    {
                        //show and hide controls
                        page.SetPage(pageUpdateProduction);
                        lblAddEditTitle.Text = "Edit Record";
                        bunifuTransition1.HideSync(pnlSide, false, BunifuAnimatorNS.Animation.Transparent);

                        // populate data
                        var obj = Factories.CreateProduction().Get(productionID);
                        dtDate.Value             = obj.Date;
                        cboProducts.SelectedItem = LocalUtils.GetSelectedItemX(cboProducts.Items, obj.ProductID.ToString());
                        txtQuantity.Text         = obj.Quantity.ToString();

                        page.SetPage(pageUpdateProduction);
                        lblAddEditTitle.Text = "Edit Record";
                        bunifuTransition1.HideSync(pnlSide, false, BunifuAnimatorNS.Animation.Transparent);
                    }
                    else
                    {
                        LocalUtils.ShowNoRecordFoundMessage(this);
                        page.SetPage(pageUpdateProduction);
                        bunifuTransition1.ShowSync(pnlSide, false, BunifuAnimatorNS.Animation.Transparent);
                    }
                }
                else
                {
                    LocalUtils.ShowNoRecordSelectedMessage(this);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #4
0
        private void SetMainData()
        {
            try
            {
                if (gridList.SelectedRows.Count > 0)
                {
                    // get id
                    expenseID = int.Parse(gridList.SelectedRows[0].Cells[0].Value.ToString());
                    if (expenseID != 0)
                    {
                        //show and hide controls
                        mainPage.SetPage(tabMainData);
                        lblAddEditTitle.Text = "Edit Record";
                        bunifuTransition1.HideSync(pnlSide, false, BunifuAnimatorNS.Animation.Transparent);

                        var obj = mainLogic.GetBy(expenseID);
                        dtDate.Value                = obj.Date;
                        txtParticulars.Text         = obj.Particular;
                        txtTotal.Text               = obj.Total.ToString();
                        txtUnitPrice.Text           = obj.UnitPrice.ToString();
                        txtQuantity.Text            = obj.Quantity.ToString();
                        cboExpenseType.SelectedItem = LocalUtils.GetSelectedItemX(cboExpenseType.Items, obj.ExpenseTypeID.ToString());
                    }
                    else
                    {
                        LocalUtils.ShowNoRecordFoundMessage(this);
                        mainPage.SetPage(tabGridList);
                        bunifuTransition1.ShowSync(pnlSide, false, BunifuAnimatorNS.Animation.Transparent);
                    }
                }
                else
                {
                    LocalUtils.ShowNoRecordSelectedMessage(this);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
 private void SetData()
 {
     try
     {
         using (var uow = new UnitOfWork(new DataContext()))
         {
             var user = uow.Users.GetUser(_userID);
             if (user != null)
             {
                 txtFirstName.Text     = user.FirstName;
                 txtLastName.Text      = user.LastName;
                 txtMiddleName.Text    = user.MiddleName;
                 txtUserName.Text      = user.UserName;
                 cboRoles.SelectedItem = LocalUtils.GetSelectedItemX(cboRoles.Items, user.Roles.First().RoleID.ToString());
             }
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Example #6
0
        public void SetData()
        {
            try
            {
                // populate data
                var model = Factories.CreateProductSale().Get(productSaleID);
                dtDate.Value = model.Date;

                cboProducts.SelectedItem   = LocalUtils.GetSelectedItemX(cboProducts.Items, model.ProductID.ToString());
                txtCustomerName.Text       = model.CustomerName;
                txtQuantity.Text           = model.Quantity.ToString();
                txtUnitPrice.Text          = model.UnitPrice.ToString();
                txtDiscount.Text           = model.Discount.ToString();
                cboOutletSaleName.Text     = model.OutletSaleName;
                chkIsBuyOneTakeOne.Checked = model.IsBuyOneTakeOne;
                txtAdditionalQuantity.Text = model.AdditionalQty.ToString();
            }
            catch (Exception ex)
            {
                LocalUtils.ShowErrorMessage(this, ex.ToString());
            }
        }
Example #7
0
 private void SetData()
 {
     try
     {
         using (var uow = new UnitOfWork(new DataContext()))
         {
             var product = uow.Products.GetProduct(_productID);
             if (product != null)
             {
                 txtDescription.Text      = product.Description;
                 txtRemarks.Text          = product.Remarks;
                 txtLimit.Text            = product.Limit.ToString();
                 txtQuantity.Text         = product.Quantity.ToString();
                 txtPrice.Text            = product.Price.HasValue ? product.Price.Value.ToString() : "0.0";
                 cboSupplier.SelectedItem = LocalUtils.GetSelectedItemX(cboSupplier.Items, product.SupplierID.ToString());
             }
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }