Пример #1
0
 public CompanyMaster(Itementry itementry)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.itementry = itementry;
     loaddata();
     a = 1;
 }
Пример #2
0
 public TaxSlab(Itementry itementry, TabControl tabControl, Master master, string activecontroal)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.itementry  = itementry;
     this.tabControl = tabControl;
     this.master     = master;
     a   = 1;
     pvc = activecontroal;
 }
 public void SaveToFile()
 {
     for (int i = 0; i < invItems.Count; i++)
     {
         if (invItems[i].name != "Empty")
         {
             Itementry temp = new Itementry();
             temp.itemName = invItems[i].name;
             temp.quantity = itemCount[i].Value;
             File.itemDB.storage.Add(temp);
         }
     }
 }
Пример #4
0
 private void btnnew_Click(object sender, EventArgs e)
 {
     try
     {
         Itementry dlg = new Itementry(master, tabControl);
         master.AddNewTab(dlg);
         //dlg.MdiParent = this.MdiParent;
         //dlg.StartPosition = FormStartPosition.CenterScreen;
         //this.Hide();
         //dlg.Show();
     }
     catch (Exception ex)
     {
         // MessageBox.Show("Error: " + ex.Message);
     }
 }
Пример #5
0
        public void open()
        {
            try
            {
                this.Enabled = false;//optional, better target a panel or specific controls
                iid          = LVclient.Items[LVclient.FocusedItem.Index].SubItems[0].Text;

                Itementry dlg = new Itementry(master, tabControl);

                dlg.Update(1);
                master.AddNewTab(dlg);
            }
            finally
            {
                this.Enabled = true;
            }
        }
Пример #6
0
        private void txtitemname_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    SqlCommand     cmd5 = new SqlCommand("select p.Product_Name,p.Unit,p.Packing,b.* from productmaster p inner join ProductPriceMaster b on p.ProductID=b.ProductID where p.product_name='" + txtitemname.Text + "'", con);
                    SqlDataAdapter sda  = new SqlDataAdapter(cmd5);
                    DataTable      dt   = new DataTable();
                    sda.Fill(dt);
                    txtpacking.Text = dt.Rows[0]["Packing"].ToString();
                    txtrate.Text    = dt.Rows[0]["PurchasePrice"].ToString();
                    txtper.Text     = dt.Rows[0]["Unit"].ToString();

                    SqlCommand     cmd6 = new SqlCommand("select * from itemtaxmaster i inner join productmaster p on i.productid=p.productid where p.product_name like'%" + txtitemname.Text + "%' and i.saletypeid like '%" + cmbsaletype.Text + "'", con);
                    SqlDataAdapter sda6 = new SqlDataAdapter(cmd6);
                    DataTable      dt1  = new DataTable();
                    sda6.Fill(dt1);
                    string istax = conn.ExecuteScalar("Select taxtypename from purchasetypemaster where type='P' and isactive=1 and purchasetypename='" + cmbsaletype.Text + "'");
                    if (dt1.Rows.Count > 0)
                    {
                        txttax.Text    = "0";
                        txtaddtax.Text = "0";
                        if (istax != "Tax Free")
                        {
                            lbltax1.Text    = "[" + Math.Round(Convert.ToDouble(dt1.Rows[0]["Vat"].ToString()), 2).ToString() + "]";
                            lbladdtax1.Text = "[" + Math.Round(Convert.ToDouble(dt1.Rows[0]["AddVat"].ToString()), 2).ToString() + "]";
                        }
                        else
                        {
                            lbltax1.Text    = "[0]";
                            lbladdtax1.Text = "[0]";
                        }

                        txtbags.Focus();
                        taxid    = Math.Round(Convert.ToDouble(dt1.Rows[0]["Vat"].ToString()), 2);
                        addtaxid = Math.Round(Convert.ToDouble(dt1.Rows[0]["AddVat"].ToString()), 2);
                    }
                    else
                    {
                        MessageBox.Show("Not any Tax Available For This Sale Type");
                        txttax.Text     = "0";
                        txtaddtax.Text  = "0";
                        lbltax1.Text    = "[0]";
                        lbladdtax1.Text = "[0]";
                        taxid           = 0;
                        addtaxid        = 0;
                        txtbags.Focus();
                    }
                }
                if (e.KeyCode == Keys.F3)
                {
                    Itementry client = new Itementry(this);

                    client.Passed(1);
                    client.Show();
                }
                if (e.KeyCode == Keys.F2)
                {
                    if (txtitemname.Text != "")
                    {
                        Itementry client = new Itementry(this);
                        client.Updatefromsale(txtitemname.Text);
                        client.Show();
                    }
                }
            }
            catch
            {
            }
        }
Пример #7
0
        private void txtitemname_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                getcon();
                if (e.KeyCode == Keys.Enter)
                {
                    SqlCommand cmd5 = new SqlCommand("select p.Product_Name, p.Unit, b.* from productmaster p inner join ProductPriceMaster b on p.ProductID=b.ProductID where p.product_name='" + txtItemName.Text + "' and p.CompanyID=" + Master.companyId + "", con);

                    SqlDataAdapter sda = new SqlDataAdapter(cmd5);
                    DataTable      dt  = new DataTable();
                    sda.Fill(dt);
                    if (dt.Rows.Count > 0)
                    {
                        txtRate.Text = dt.Rows[0]["PurchasePrice"].ToString();
                        txtPer.Text  = dt.Rows[0]["Unit"].ToString();
                    }
                    else
                    {
                        txtRate.Text = "0";
                        txtPer.Text  = "QTY";
                    }
                    flag                = 1;
                    txtDiscount.Text    = "0.00";
                    txtDiscountPer.Text = "0.00";
                    flag                = 0;
                    txtQty.Text         = "1";

                    SqlCommand     cmd6 = new SqlCommand("select i.Vat,i.addvat from itemtaxmaster i inner join productmaster p on i.productid=p.productid where p.product_name like'%" + txtItemName.Text + "%' and i.saletypeid like '%" + cmbPurchaseType.Text + "'", con);
                    SqlDataAdapter sda6 = new SqlDataAdapter(cmd6);
                    DataTable      dt1  = new DataTable();
                    sda6.Fill(dt1);
                    if (dt1.Rows.Count > 0)
                    {
                        txtVat.Text    = dt1.Rows[0]["Vat"].ToString();
                        txtAddVat.Text = dt1.Rows[0]["addVat"].ToString();
                        txtQty.Focus();
                        itemcalculation(txtQty.Text);
                    }
                    else
                    {
                        MessageBox.Show("Not any Tax Available For This Sale Type");
                        txtVat.Text    = "0";
                        txtAddVat.Text = "0";
                        txtQty.Focus();
                    }
                }
                if (e.KeyCode == Keys.F3)
                {
                    Itementry client = new Itementry(this);
                    client.Passed(1);
                    client.Show();
                }
                if (e.KeyCode == Keys.F2)
                {
                    if (txtItemName.Text != "")
                    {
                        Itementry client = new Itementry(this);
                        client.Updatefromsale(txtItemName.Text);
                        client.Show();
                    }
                }
            }
            catch
            {
            }
        }