Exemplo n.º 1
0
        private void cmbCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.nupAmount.Value = 0;
            if (cmbCategory.SelectedItem != null)
            {
                Guid categoryGuid             = new Guid(cmbCategory.SelectedItem.ToString());
                CompanyCollection companyList = new CompanyCollection();
                if (cmbCompany.SelectedItem == null)
                {
                    this.cmbCompany.DataSource    = companyList;
                    this.cmbCompany.DisplayMember = "DisplayName";
                }
            }
            this.nupAmount.Value = 0;
            if (cmbCategory.SelectedItem != null && cmbCompany.SelectedItem != null && cmbItem.SelectedItem != null)
            {
                availableStock = 0;
                Medicines m = new Medicines();
                availableStock               = m.GetMaxQuantityAvailable(cmbCategory.SelectedItem as Category, cmbCompany.SelectedItem as Company, cmbItem.SelectedItem as Item);
                lblAvailableQuantity.Text    = "Max Available (" + availableStock.ToString() + " )";
                lblAvailableQuantity.Visible = true;

                MedicineSale MSale  = new MedicineSale();
                decimal      mrp    = MSale.GetMRP(cmbCategory.SelectedItem as Category, cmbCompany.SelectedItem as Company, cmbItem.SelectedItem as Item);
                decimal      amount = mrp * (this.nupQuantity.Value);
                this.nupAmount.Value = amount;
            }
        }
 private void nupQuantity_Leave(object sender, EventArgs e)
 {
     this.nupAmount.Value   = 0;
     this.nupQuantity.Value = 0;
     if (cmbCategory.SelectedItem != null && cmbCompany.SelectedItem != null && cmbItem.SelectedItem != null)
     {
         MedicineSale MSale  = new MedicineSale();
         decimal      mrp    = MSale.GetMRP(cmbCategory.SelectedItem as Category, cmbCompany.SelectedItem as Company, cmbItem.SelectedItem as Item);
         decimal      amount = mrp * (this.nupQuantity.Value);
         this.nupAmount.Value = amount;
     }
 }
Exemplo n.º 3
0
        private void cmbItem_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.nupAmount.Value = 0;
            if (cmbCategory.SelectedItem != null && cmbCompany.SelectedItem != null && cmbItem.SelectedItem != null)
            {
                availableStock = 0;
                Medicines m = new Medicines();
                availableStock               = m.GetMaxQuantityAvailable(cmbCategory.SelectedItem as Category, cmbCompany.SelectedItem as Company, cmbItem.SelectedItem as Item);
                lblAvailableQuantity.Text    = "Max Available (" + availableStock.ToString() + " )";
                lblAvailableQuantity.Visible = true;

                MedicineSale MSale  = new MedicineSale();
                decimal      mrp    = MSale.GetMRP(cmbCategory.SelectedItem as Category, cmbCompany.SelectedItem as Company, cmbItem.SelectedItem as Item);
                decimal      amount = mrp * (this.nupQuantity.Value);
                this.nupAmount.Value = amount;
            }
        }
Exemplo n.º 4
0
        private void nupQuantity_Leave(object sender, EventArgs e)
        {
            this.nupAmount.Value   = 0;
            this.nupQuantity.Value = 0;
            if (cmbCategory.SelectedItem != null && cmbCompany.SelectedItem != null && cmbItem.SelectedItem != null)
            {
                MedicineSale MSale = new MedicineSale();
                decimal      mrp   = MSale.GetMRP(cmbCategory.SelectedItem as Category, cmbCompany.SelectedItem as Company, cmbItem.SelectedItem as Item);

                if (nupQuantity.Text != "")
                {
                    //this.mEntry.Quantity = int.Parse(nupQuantity.Text);
                    decimal amount = mrp * int.Parse(this.nupQuantity.Text);
                    this.nupAmount.Value = amount;
                }
                else
                {
                    this.mEntry.Quantity = 0;
                }
            }
        }