예제 #1
0
        private void txt_code_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (T_StockDL.ExistingT_Stock(txt_code.Text.Trim(), commonFunctions.GlobalCompany, commonFunctions.GlobalLocation))
                {
                    if (!commonFunctions.IsExist(dataGridView1, txt_code.Text.Trim()))
                    {
                        T_Stock stk = new T_Stock();
                        stk.Locacode  = commonFunctions.GlobalLocation;
                        stk.Compcode  = commonFunctions.GlobalCompany;
                        stk.ProductId = txt_code.Text.Trim();
                        T_StockDL bal = new T_StockDL();
                        stk = bal.Selectt_Stock(stk);

                        txt_cost.Text    = stk.CostPrice.ToString();
                        txt_selling.Text = stk.SellingPrice.ToString();
                        lbl_name.Text    = stk.Descr;

                        txt_qty.Text = "0";
                        txt_qty.Focus();

                        errorProvider1.Clear();
                        already = false;
                    }
                    else
                    {
                        already = true;
                        //errorProvider1.SetError(txt_code, "Already exists");
                        T_Stock stk = new T_Stock();
                        stk.Locacode  = commonFunctions.GlobalLocation;
                        stk.Compcode  = commonFunctions.GlobalCompany;
                        stk.ProductId = txt_code.Text.Trim();
                        T_StockDL bal = new T_StockDL();
                        stk = bal.Selectt_Stock(stk);

                        txt_cost.Text    = stk.CostPrice.ToString();
                        txt_selling.Text = stk.SellingPrice.ToString();
                        lbl_name.Text    = stk.Descr;

                        DataGridViewRow drowx = new DataGridViewRow();
                        drowx = commonFunctions.GetRow(dataGridView1, txt_code.Text.Trim());

                        txt_qty.Text = drowx.Cells["Quntity"].Value.ToString();

                        txt_qty.Focus();
                    }
                }
                else
                {
                    errorProvider1.SetError(txt_code, "Product you have entered not exist in the bin card");
                }
            }
        }
예제 #2
0
        private void filldata()
        {
            T_StockDL bdl = new T_StockDL();
            DataTable dt  = bdl.SelectAllt_Stock(2, commonFunctions.GlobalCompany, commonFunctions.GlobalLocation);

            foreach (DataRow drow in dt.Rows)
            {
                txt_code.AutoCompleteCustomSource.Add(drow["ProductId"].ToString());
                listBox1.Items.Add(drow["ProductId"].ToString());
            }
        }
예제 #3
0
 public static T_Stock Get_StockObj(string stkcode, string company, string loca)
 {
     try
     {
         T_Stock stk = new T_Stock();
         stk.StockCode = stkcode.Trim();
         stk.Compcode  = company;
         stk.Locacode  = loca;
         stk           = new T_StockDL().Selectt_Stock_ByStockCode(stk);
         return(stk);
     }
     catch (Exception ex) {
         throw ex;
     }
 }
예제 #4
0
        public static T_Stock GetStockdetails(string stockcode)
        {
            T_Stock stk = new T_Stock();

            try
            {
                stk.Locacode  = commonFunctions.GlobalLocation;
                stk.Compcode  = commonFunctions.GlobalCompany;
                stk.StockCode = stockcode;
                stk           = new T_StockDL().Selectt_Stock_new(stk);
            }
            catch (Exception ex)
            {
            }
            return(stk);
        }
예제 #5
0
        public static decimal GetCurrentStock(string stockcode)
        {
            decimal stock = decimal.Zero;

            try
            {
                T_Stock stk = new T_Stock();
                stk.Locacode  = commonFunctions.GlobalLocation;
                stk.Compcode  = commonFunctions.GlobalCompany;
                stk.StockCode = stockcode.Trim();
                stk           = new T_StockDL().Selectt_Stock_new(stk);
                stock         = stk.Stock.Value;
            }
            catch (Exception ex) {
            }
            return(stock);
        }
예제 #6
0
        public static string GetProductCode(string stockcode)
        {
            string stock = "";

            try
            {
                T_Stock stk = new T_Stock();
                stk.Locacode  = commonFunctions.GlobalLocation;
                stk.Compcode  = commonFunctions.GlobalCompany;
                stk.StockCode = stockcode.Trim();
                stk           = new T_StockDL().Selectt_Stock_new(stk);
                stock         = stk.ProductId.Trim();
            }
            catch (Exception ex)
            {
            }
            return(stock);
        }
예제 #7
0
        public static string FindExisitingStock(string suppcode)
        {
            string str = "";

            if (T_StockDL.ExistingT_Stock_new(suppcode.Trim(), commonFunctions.GlobalCompany, commonFunctions.GlobalLocation))
            {
                T_Stock cat = new T_Stock();
                cat.StockCode = suppcode.Trim();
                cat.Compcode  = commonFunctions.GlobalCompany;
                cat.Locacode  = commonFunctions.GlobalLocation;
                str           = new T_StockDL().Selectt_Stock_ByStockCode(cat).Descr;
            }
            else
            {
                str = "<Error!!!>";
            }
            return(str);
        }
예제 #8
0
        private void GetData()
        {
            try
            {
                T_StockDL bdl = new T_StockDL();
                dataGridView1.DataSource = bdl.SelectAllt_Stock(2, commonFunctions.GlobalCompany, commonFunctions.GlobalLocation);

                if (dataGridView1.DataSource != null)
                {
                    dataGridView1.Columns[0].Width = 120;
                    dataGridView1.Columns[1].Width = 585;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }