Example #1
0
 private void BarCodeGrid_Click(object sender, EventArgs e)
 {
     try
     {
         DataRow currentrow = BarCodeGridView.GetDataRow(BarCodeGridView.FocusedRowHandle);
         ShowImage(currentrow["SFDARTID"].ToString());
     }
     catch (Exception ex)
     {
         ProjectFunctions.SpeakError(ex.Message);
     }
 }
Example #2
0
 private void HelpGrid_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         if (HelpGrid.Text == "Load")
         {
             int i = 0;
             foreach (DataRow dr in (HelpGrid.DataSource as DataTable).Rows)
             {
                 if (dr["Select"].ToString().ToUpper() == "TRUE")
                 {
                     DataSet ds = ProjectFunctions.GetDataSet("sp_LoadDataFSKUFGridFromHO '" + dr["SKUVOUCHNO"].ToString() + "','" + GlobalVariables.FinancialYear + "','" + GlobalVariables.CUnitID + "'");
                     if (i == 0)
                     {
                         dt.Clear();
                         dt = ds.Tables[0];
                         i++;
                     }
                     else
                     {
                         dt.Merge(ds.Tables[0]);
                     }
                 }
             }
             if (dt.Rows.Count > 0)
             {
                 decimal QtySum = 0;
                 foreach (DataRow dr in dt.Rows)
                 {
                     dr["SFDBOXNO"] = Convert.ToDecimal(lblBox.Text);
                     QtySum         = QtySum + Convert.ToDecimal(dr["SFDSCANQTY"]);
                 }
                 lblTotQty.Text         = QtySum.ToString("0");
                 BarCodeGrid.DataSource = dt;
                 BarCodeGridView.BestFitColumns();
             }
             else
             {
                 BarCodeGrid.DataSource = null;
             }
             HelpGrid.Visible = false;
         }
     }
     catch (Exception ex)
     {
         ProjectFunctions.SpeakError(ex.Message);
     }
 }
Example #3
0
        private void FrmPurchaseFromHO_Load(object sender, EventArgs e)
        {
            try
            {
                ProjectFunctions.GirdViewVisualize(BarCodeGridView);
                ProjectFunctions.GirdViewVisualize(HelpGridView);
                ProjectFunctions.ToolStripVisualize(Menu_ToolStrip);
                ProjectFunctions.TextBoxVisualize(this);
                if (S1 == "&Add")
                {
                    string MemoNo = ProjectFunctions.GetDataSet("select isnull(max(SFMVNO),0)+1 from SFMAIN where SFMFNYR='" + GlobalVariables.FinancialYear + "' And UnitCode='" + GlobalVariables.CUnitID + "'").Tables[0].Rows[0][0].ToString();
                    txtMemoNo.Text        = MemoNo;
                    lblBox.Text           = "1";
                    txtMemoDate.EditValue = DateTime.Now;
                    lblTotQty.Text        = "0";
                    txtBarCode.Focus();
                }
                if (S1 == "Edit")
                {
                    DataSet ds = ProjectFunctions.GetDataSet("SP_LoadBoxDataFEdit '" + SFDVNO + "' ,'" + SFMTOTBOX + "','" + GlobalVariables.FinancialYear + "','" + GlobalVariables.CUnitID + "' ");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        txtMemoDate.EditValue = Convert.ToDateTime(ds.Tables[0].Rows[0]["SFDVDATE"]);
                        txtMemoNo.EditValue   = SFDVNO;
                        dt = ds.Tables[0];
                        BarCodeGrid.DataSource = dt;
                        BarCodeGridView.BestFitColumns();

                        decimal QtySum = 0;
                        foreach (DataRow dr in dt.Rows)
                        {
                            lblBox.Text = Convert.ToDecimal(dr["SFDBOXNO"]).ToString("0");
                            QtySum      = QtySum + Convert.ToDecimal(dr["SFDSCANQTY"]);
                        }
                        lblTotQty.Text = QtySum.ToString("0");
                    }
                }
            }
            catch (Exception ex)
            {
                ProjectFunctions.SpeakError(ex.Message);
            }
        }
        private void TxtBarCode_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    DataSet dsCheck = ProjectFunctions.GetDataSet("Select * from SKU Where SKUPRODUCTCODE='" + txtBarCode.Text + "' And UnitCode='" + GlobalVariables.CUnitID + "'");
                    if (dsCheck.Tables[0].Rows.Count > 0)
                    {
                        if (dsCheck.Tables[0].Rows[0]["Used"].ToString().ToUpper() == "Y")
                        {
                            ProjectFunctions.SpeakError("BarCode Already Loaded");
                            txtBarCode.SelectAll();
                            txtBarCode.Focus();
                            e.Handled = true;
                            return;
                        }
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["SFDBARCODE"].ToString().ToUpper() == txtBarCode.Text.Trim().ToUpper())
                            {
                                ProjectFunctions.SpeakError("BarCode Already Loaded In This Document");
                                txtBarCode.SelectAll();
                                txtBarCode.Focus();
                                e.Handled = true;
                                return;
                            }
                        }
                        DataSet ds       = ProjectFunctions.GetDataSet("sp_LoadDataFromSKU '" + txtBarCode.Text + "','" + GlobalVariables.CUnitID + "'");
                        DataRow drNewRow = dt.NewRow();
                        drNewRow["SFDBOXNO"]   = lblBox.Text;
                        drNewRow["SFDBARCODE"] = ds.Tables[0].Rows[0]["SKUPRODUCTCODE"].ToString();
                        drNewRow["SFDARTNO"]   = ds.Tables[0].Rows[0]["ARTNO"].ToString();
                        drNewRow["SFDARTDESC"] = ds.Tables[0].Rows[0]["ARTDESC"].ToString();
                        drNewRow["SFDCOLN"]    = ds.Tables[0].Rows[0]["COLNAME"].ToString();
                        drNewRow["SFDSIZN"]    = ds.Tables[0].Rows[0]["SZNAME"].ToString();
                        drNewRow["SFDSCANQTY"] = Convert.ToDecimal("1");
                        drNewRow["SFDARTMRP"]  = Convert.ToDecimal(ds.Tables[0].Rows[0]["SKUMRP"]);
                        drNewRow["SFDARTWSP"]  = Convert.ToDecimal(ds.Tables[0].Rows[0]["SKUWSP"]);
                        drNewRow["SFDARTID"]   = Convert.ToDecimal(ds.Tables[0].Rows[0]["SKUARTID"]).ToString();


                        ShowImage(Convert.ToDecimal(ds.Tables[0].Rows[0]["SKUARTID"]).ToString());

                        drNewRow["SFDCOLID"] = Convert.ToDecimal(ds.Tables[0].Rows[0]["SKUCOLID"]);
                        drNewRow["SFDSIZID"] = Convert.ToDecimal(ds.Tables[0].Rows[0]["SKUSIZID"]);
                        dt.Rows.Add(drNewRow);
                        if (dt.Rows.Count > 0)
                        {
                            BarCodeGrid.DataSource = dt;
                            BarCodeGridView.BestFitColumns();
                            txtBarCode.Text = string.Empty;
                            lblTotQty.Text  = Convert.ToDecimal(gridColumn7.SummaryItem.SummaryValue).ToString("0");
                        }
                        else
                        {
                            BarCodeGrid.DataSource = null;
                        }
                    }
                    else
                    {
                        ProjectFunctions.SpeakError("Bar Code Not Generated");
                        txtBarCode.SelectAll();
                        txtBarCode.Focus();
                        e.Handled = true;
                        return;
                    }
                }
                txtBarCode.Focus();
            }
            catch (Exception ex)
            {
                ProjectFunctions.SpeakError(ex.Message);
            }
            e.Handled = true;
        }