Example #1
0
        private void FrmIndentPassing_Load(object sender, EventArgs e)
        {
            SetMyControls();
            DataSet ds = ProjectFunctions.GetDataSet("sp_LoadIndDataFPassing '" + IndentNo + "','" + IndentDate.Date.ToString("yyyy-MM-dd") + "'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                ds.Tables[0].Columns.Add("PassUnPass", typeof(bool));

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (dr["IndPassTag"].ToString().ToUpper() == "Y")
                    {
                        dr["PassUnPass"] = true;
                    }
                    else
                    {
                        dr["PassUnPass"] = false;
                    }
                }

                HelpGrid.DataSource = ds.Tables[0];
                HelpGrid.Visible    = true;
                HelpGrid.Focus();
                HelpGridView.BestFitColumns();
            }
        }
        private void LoadLayoutForms()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("ProgCode", typeof(string));
            dt.Columns.Add("LayoutName", typeof(string));
            string Address = string.Format(@"{0}\Layouts\{1}\", GlobalVariables.LayoutLocation, GlobalVariables.CurrentUser);

            string[] Dir = System.IO.Directory.GetDirectories(Address);
            foreach (string StrDir in Dir)
            {
                string[] DirFiles = System.IO.Directory.GetFiles(StrDir);
                foreach (string StrFiles in DirFiles)
                {
                    DataRow dr = dt.NewRow();
                    dr["ProgCode"]   = StrDir.Replace(Address, string.Empty);
                    dr["LayoutName"] = StrFiles.Replace(StrDir, string.Empty).Replace(@"\", string.Empty);
                    dt.Rows.Add(dr);
                }
            }

            if (dt.Rows.Count > 0)
            {
                HelpGrid.DataSource = dt;
                HelpGrid.Visible    = true;
                HelpGridView.BestFitColumns();
                HelpGrid.BringToFront();
                HelpGrid.Focus();
            }
        }
        private void TxtEmpCode_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                HelpGridView.Columns.Clear();
                HelpGrid.Text = "EmpCode";
                if (txtEmpCode.Text.Length == 0)
                {
                    var ds = ProjectFunctions.GetDataSet("SELECT     empmst.EmpCode, empmst.EmpName, DeptMst.DeptDesc FROM         empmst LEFT OUTER JOIN DeptMst ON empmst.EmpDeptCode = DeptMst.DeptCode ");
                    HelpGrid.DataSource = ds.Tables[0];
                    HelpGridView.BestFitColumns();
                    HelpGrid.Show();
                    HelpGrid.Focus();
                }
                else
                {
                    var ds = ProjectFunctions.GetDataSet("SELECT     empmst.EmpCode, empmst.EmpName, DeptMst.DeptDesc FROM         empmst LEFT OUTER JOIN DeptMst ON empmst.EmpDeptCode = DeptMst.DeptCode Where EmpCode='" + txtEmpCode.Text.Trim() + "'");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        txtEmpCode.Text = ds.Tables[0].Rows[0]["EmpCode"].ToString();

                        btnLoad_Data.Focus();
                    }
                    else
                    {
                        var ds1 = ProjectFunctions.GetDataSet("SELECT  empmst.EmpCode, empmst.EmpName, DeptMst.DeptDesc FROM  empmst LEFT OUTER JOIN DeptMst ON empmst.EmpDeptCode = DeptMst.DeptCode");
                        HelpGrid.DataSource = ds1.Tables[0];
                        HelpGridView.BestFitColumns();
                        HelpGrid.Show();
                        HelpGrid.Focus();
                    }
                }
            }
            e.Handled = true;
        }
 private void TxtSGrpCode_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             HelpGridView.Columns.Clear();
             HelpGrid.Text = "txtSGrpCode";
             DataSet ds = ProjectFunctions.GetDataSet("Select GrpSubCode,GrpSubDesc,GrpCode,GrpDesc,GrpHSNCode from GrpMst");
             if (ds.Tables[0].Rows.Count > 0)
             {
                 HelpGrid.DataSource = ds.Tables[0];
                 HelpGrid.Visible    = true;
                 HelpGrid.Focus();
                 HelpGridView.BestFitColumns();
             }
             else
             {
                 ProjectFunctions.SpeakError("No Records To Display");
             }
         }
         e.Handled = true;
     }
     catch (Exception ex)
     {
         ProjectFunctions.SpeakError(ex.Message);
     }
 }
        private void TxtProductACode_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                HelpGridView.Columns.Clear();
                HelpGrid.Text = "txtProductACode";
                if (txtProductACode.Text.Trim().Length == 0)
                {
                    DataSet ds = ProjectFunctions.GetDataSet("SELECT PrdMst.PrdCode,PrdMst.PrdAsgnCode, PrdMst.PrdName From PrdMst Where PrdActive='Y'");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        HelpGrid.DataSource = ds.Tables[0];
                        HelpGrid.Show();
                        HelpGrid.Visible = true;
                        HelpGrid.Focus();
                        HelpGridView.BestFitColumns();
                    }
                    else
                    {
                        ProjectFunctions.SpeakError("No Records To Display");
                    }
                }
                else
                {
                    DataSet ds = ProjectFunctions.GetDataSet("SELECT PrdMst.PrdCode,PrdMst.PrdAsgnCode, PrdMst.PrdName From PrdMst Where PrdActive='Y' And PrdAsgnCode='" + txtProductACode.Text + "'");

                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        txtProductACode.Text = ds.Tables[0].Rows[0]["PrdAsgnCode"].ToString();
                        txtProductName.Text  = ds.Tables[0].Rows[0]["PrdName"].ToString();
                        txtProductCode.Text  = ds.Tables[0].Rows[0]["PrdCode"].ToString();

                        txtProductQty.Focus();
                    }
                    else
                    {
                        DataSet ds1 = ProjectFunctions.GetDataSet("SELECT PrdMst.PrdCode,PrdMst.PrdAsgnCode, PrdMst.PrdName From PrdMst Where PrdActive='Y'");
                        if (ds1.Tables[0].Rows.Count > 0)
                        {
                            HelpGrid.DataSource = ds.Tables[0];
                            HelpGrid.Show();
                            HelpGrid.Visible = true;
                            HelpGrid.Focus();
                            HelpGridView.BestFitColumns();
                        }
                        else
                        {
                            ProjectFunctions.SpeakError("No Records To Display");
                        }
                    }
                }
            }
            e.Handled = true;
        }
 private void txtProductACode_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         HelpGrid.Text = "txtProductACode";
         if (txtProductACode.Text.Trim().Length == 0)
         {
             DataSet ds = ProjectFunctions.GetDataSet("SELECT     InvoiceData.IdPrdCode, PrdMst.PrdAsgnCode, PrdMst.PrdName, InvoiceData.IdPrdRate, InvoiceData.IdDiscRate,InvoiceData.IdSchmQty,InvoiceData.IdSchmQtyF FROM         InvoiceData INNER JOIN PrdMst ON InvoiceData.IdPrdCode = PrdMst.PrdCode Where IdType='S' And IdDate='" + Convert.ToDateTime(txtAgainstInvDate.Text).ToString("yyyy-MM-dd") + "' And IdNo='" + txtAgainstInvNo.Text.Trim() + "'");
             if (ds.Tables[0].Rows.Count > 0)
             {
                 HelpGrid.DataSource = ds.Tables[0];
                 HelpGrid.Visible    = true;
                 HelpGrid.Focus();
                 HelpGridView.BestFitColumns();
             }
             else
             {
                 ProjectFunctions.SpeakError("No Record To Display");
                 txtProductACode.Focus();
             }
         }
         else
         {
             DataSet ds = ProjectFunctions.GetDataSet("SELECT     InvoiceData.IdPrdCode, PrdMst.PrdAsgnCode, PrdMst.PrdName, InvoiceData.IdPrdRate, InvoiceData.IdDiscRate,InvoiceData.IdSchmQty,InvoiceData.IdSchmQtyF FROM         InvoiceData INNER JOIN PrdMst ON InvoiceData.IdPrdCode = PrdMst.PrdCode Where IdType='S' And IdDate='" + Convert.ToDateTime(txtAgainstInvDate.Text).ToString("yyyy-MM-dd") + "' And IdNo='" + txtAgainstInvNo.Text.Trim() + "' And PrdAsgnCode='" + txtProductACode.Text.Trim() + "'");
             if (ds.Tables[0].Rows.Count > 0)
             {
                 txtProductACode.Text = ds.Tables[0].Rows[0]["PrdAsgnCode"].ToString();
                 txtProductCode.Text  = ds.Tables[0].Rows[0]["IdPrdCode"].ToString();
                 txtProductName.Text  = ds.Tables[0].Rows[0]["PrdName"].ToString();
                 txtProductRate.Text  = ds.Tables[0].Rows[0]["IdPrdRate"].ToString();
                 txtRdc.Text          = ds.Tables[0].Rows[0]["IdDiscRate"].ToString();
                 txtSchmQty.Text      = ds.Tables[0].Rows[0]["IdSchmQty"].ToString();
                 txtSchmQtyF.Text     = ds.Tables[0].Rows[0]["IdSchmQtyF"].ToString();
                 txtProductQty.Focus();
             }
             else
             {
                 DataSet ds1 = ProjectFunctions.GetDataSet("SELECT     InvoiceData.IdPrdCode, PrdMst.PrdAsgnCode, PrdMst.PrdName, InvoiceData.IdPrdRate, InvoiceData.IdDiscRate,InvoiceData.IdSchmQty,InvoiceData.IdSchmQtyF FROM         InvoiceData INNER JOIN PrdMst ON InvoiceData.IdPrdCode = PrdMst.PrdCode Where IdType='S' And IdDate='" + Convert.ToDateTime(txtAgainstInvDate.Text).ToString("yyyy-MM-dd") + "' And IdNo='" + txtAgainstInvNo.Text.Trim() + "'");
                 if (ds1.Tables[0].Rows.Count > 0)
                 {
                     HelpGrid.DataSource = ds1.Tables[0];
                     HelpGrid.Visible    = true;
                     HelpGrid.Focus();
                     HelpGridView.BestFitColumns();
                 }
                 else
                 {
                     ProjectFunctions.SpeakError("No Record To Display");
                     txtProductACode.Focus();
                 }
             }
         }
     }
 }
        private void TxtTDSCode_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                HelpGrid.Text = "txtTDSCode";
                if (txtTDSCode.Text.Trim().Length == 0)
                {
                    DataSet ds = ProjectFunctions.GetDataSet("select TdsCode,TdsDesc,TdsRate,TdsSRate,TdsUS from TdsMst ");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        HelpGrid.DataSource = ds.Tables[0];
                        HelpGrid.Show();
                        HelpGrid.Focus();
                        HelpGridView.BestFitColumns();
                    }
                }
                else
                {
                    DataSet ds = ProjectFunctions.GetDataSet("select TdsCode,TdsDesc,TdsRate,TdsSRate,TdsUS from TdsMst Where TdsCode='" + txtTDSCode.Text.Trim() + "'");

                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        txtTDSCode.Text      = ds.Tables[0].Rows[0]["TdsCode"].ToString();
                        txtTDSDesc.Text      = ds.Tables[0].Rows[0]["TdsDesc"].ToString();
                        txtTDSRate.Text      = ds.Tables[0].Rows[0]["TdsRate"].ToString().Trim();
                        txtTDSSurcharge.Text = ds.Tables[0].Rows[0]["TdsSRate"].ToString();
                        txtUnderSection.Text = ds.Tables[0].Rows[0]["TdsUS"].ToString();
                        if (txtTDSRate.Text == "0")
                        {
                            txtTDSAmount.Enabled = true;
                            txtSurcOnTDS.Enabled = true;
                        }
                        else
                        {
                            txtTDSAmount.Enabled = false;
                            txtSurcOnTDS.Enabled = false;
                        }
                        txtOnAmount.Focus();
                    }
                    else
                    {
                        DataSet ds1 = ProjectFunctions.GetDataSet("select TdsCode,TdsDesc,TdsRate,TdsSRate,TdsUS from TdsMst ");
                        if (ds1.Tables[0].Rows.Count > 0)
                        {
                            HelpGrid.DataSource = ds1.Tables[0];
                            HelpGrid.Show();
                            HelpGrid.Focus();
                            HelpGridView.BestFitColumns();
                        }
                    }
                }
            }
        }
Example #8
0
        private void TxtEmpCode_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                PrepareEmpGrid();
                var strQry = string.Empty;
                HelpGrid.Text = "txtEmpCode";
                var ds = new DataSet();
                if (e.KeyCode == Keys.Enter)
                {
                    if (txtEmpCode.Text.Length == 0)
                    {
                        strQry = strQry + "select Empcode as Code,Empname as Description,EmpImage from EmpMst  order by Empname";
                        ds     = ProjectFunctions.GetDataSet(strQry);
                        HelpGrid.DataSource = ds.Tables[0];
                        HelpGridView.BestFitColumns();
                        HelpGrid.Show();
                        HelpGrid.Focus();
                    }
                    else
                    {
                        strQry = strQry + "select empcode as Code,empname as Description,EmpImage from EmpMst wHERE  empcode= '" + txtEmpCode.Text.ToString().Trim() + "' ";

                        ds = ProjectFunctions.GetDataSet(strQry);
                        if (ds.Tables[0].Rows.Count > 0)

                        {
                            DataRow dr = ds.Tables[0].Rows[0];
                            txtEmpCode.Text     = dr["Code"].ToString().Trim().ToUpper();
                            txtEmpCodeDesc.Text = dr["Description"].ToString().Trim().ToUpper();
                            pictureBox1.Image   = ImageUtils.ConvertBinaryToImage((byte[])dr["EmpImage"]);
                            txtStatusCode.Focus();
                        }
                        else
                        {
                            var strQry1 = string.Empty;
                            strQry1 = strQry1 + "select empcode as Code,empname as Description,EmpImage from EmpMst  order by Empname";
                            var ds1 = ProjectFunctions.GetDataSet(strQry1);
                            HelpGrid.DataSource = ds1.Tables[0];
                            HelpGridView.BestFitColumns();
                            HelpGrid.Show();
                            HelpGrid.Focus();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            e.Handled = true;
        }
Example #9
0
        private void TxtDebitPartyCode_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                PrepareActMstHelpGrid();
                HelpGrid.Text = "txtDebitPartyCode";
                if (txtDebitPartyCode.Text.Trim().Length == 0)
                {
                    DataSet ds = ProjectFunctions.GetDataSet("sp_LoadActMstHelp");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        HelpGrid.DataSource = ds.Tables[0];
                        HelpGrid.Show();
                        HelpGrid.Visible = true;
                        HelpGrid.Focus();
                        HelpGridView.BestFitColumns();
                    }
                    else
                    {
                        ProjectFunctions.SpeakError("No Records To Display");
                    }
                }
                else
                {
                    DataSet ds = ProjectFunctions.GetDataSet(" sp_LoadActMstHelpWithCode '" + txtDebitPartyCode.Text.Trim() + "'");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        txtDebitPartyCode.Text = ds.Tables[0].Rows[0]["AccCode"].ToString();
                        txtDebitPartyName.Text = ds.Tables[0].Rows[0]["AccName"].ToString();
                        txtDocType.Focus();
                    }

                    else
                    {
                        DataSet ds1 = ProjectFunctions.GetDataSet("sp_LoadActMstHelp");
                        if (ds1.Tables[0].Rows.Count > 0)
                        {
                            HelpGrid.DataSource = ds.Tables[0];
                            HelpGrid.Show();
                            HelpGrid.Visible = true;
                            HelpGrid.Focus();
                            HelpGridView.BestFitColumns();
                        }
                        else
                        {
                            ProjectFunctions.SpeakError("No Records To Display");
                        }
                    }
                }
            }
            e.Handled = true;
        }
        private void frmRateFeeding_Load(object sender, EventArgs e)
        {
            SetMyControls();
            DataSet ds = ProjectFunctions.GetDataSet("sp_LoadRates '" + DealerCode + "'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                HelpGrid.DataSource = ds.Tables[0];
                HelpGrid.Visible    = true;
                HelpGrid.Focus();
                HelpGridView.BestFitColumns();
            }
        }
        private void btnLoadOrder_Click(object sender, EventArgs e)
        {
            HelpGrid.Text = "Bill";
            DataSet ds = ProjectFunctions.GetDataSet("SELECT     InvoiceMst.ImNo, InvoiceMst.ImDate, InvoiceMst.ImDealerCode, ActMst.AccName,InvoiceMst.ImCrates1,InvoiceMst.ImCrates2 FROM         InvoiceMst INNER JOIN ActMst ON InvoiceMst.ImDealerCode = ActMst.AccCode Where InvoiceMst.ImType='S' And InvoiceMst.ImRetCratesNo is null And ImDate>='" + DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd") + "'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                HelpGrid.DataSource = ds.Tables[0];
                HelpGrid.Show();
                HelpGrid.Visible = true;
                HelpGrid.Focus();
                HelpGridView.BestFitColumns();
            }
        }
        private void BtnSKU_Click(object sender, EventArgs e)
        {
            DataSet ds = ProjectFunctions.GetDataSet("select distinct SKUVOUCHNO, SKUFNYR from SKU where SKUSYSDATE >= '2021-04-01' and isnull(skupartybarcode,'') <>'' order by SKUFNYR, SKUVOUCHNO desc");

            if (ds.Tables[0].Rows.Count > 0)
            {
                HelpGridView.Columns.Clear();
                HelpGrid.Text       = "SKU";
                HelpGrid.DataSource = ds.Tables[0];
                HelpGridView.BestFitColumns();
                HelpGrid.Show();
                HelpGrid.Focus();
            }
        }
        private void BtnBestMatch_Click(object sender, EventArgs e)
        {
            DataSet ds = ProjectFunctionsUtils.GetDataSetBusy("Select Code as MasterCode1,Name as PrintName from MASTER1  Where Name like '%" + txtAcName.Text + "%'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                HelpGrid.Text       = "txtAccCodeBusy";
                HelpGrid.DataSource = ds.Tables[0];
                HelpGrid.BringToFront();
                HelpGrid.Show();
                HelpGrid.Focus();
                HelpGridView.BestFitColumns();
            }
        }
 private void TxtStoreCode_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         DataSet ds = ProjectFunctions.GetDataSet("select AccDCCode,AccName from ActMstAddInf  where isnull(AccDCCode,'') <>''");
         if (ds.Tables[0].Rows.Count > 0)
         {
             HelpGridView.Columns.Clear();
             HelpGrid.Text       = "STORE";
             HelpGrid.DataSource = ds.Tables[0];
             HelpGridView.BestFitColumns();
             HelpGrid.Show();
             HelpGrid.Focus();
         }
     }
     e.Handled = true;
 }
Example #15
0
 private void TxtYarnCode_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         DataSet ds = ProjectFunctions.GetDataSet("sp_LoadFabricMstFHelp");
         if (ds.Tables[0].Rows.Count > 0)
         {
             HelpGridView.Columns.Clear();
             HelpGrid.DataSource = ds.Tables[0];
             HelpGridView.BestFitColumns();
             HelpGrid.Show();
             HelpGrid.Visible = true;
             HelpGrid.Focus();
         }
     }
     e.Handled = true;
 }
 private void TxtSubLedgerCode_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         DataSet ds = ProjectFunctions.GetDataSet(" select GrpSubDesc,GrpDesc,GrpCode,GrpSubCode  from BSHeadGrpMst Where grpsubcode is not null");
         if (ds.Tables[0].Rows.Count > 0)
         {
             HelpGrid.Text = "txtMainLedgerCode";
             HelpGridView.Columns.Clear();
             HelpGrid.DataSource = ds.Tables[0];
             HelpGridView.BestFitColumns();
             HelpGrid.Show();
             HelpGrid.BringToFront();
             HelpGrid.Focus();
         }
     }
     e.Handled = true;
 }
Example #17
0
 private void TxtArtNo_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.KeyCode == System.Windows.Forms.Keys.Enter)
     {
         HelpGridView.Columns.Clear();
         HelpGrid.Text = "txtArtNo";
         if (txtArtNo.Text.Length == 0)
         {
             DataSet ds = ProjectFunctions.GetDataSet("SELECT ARTICLE.ARTSYSID, ARTICLE.ARTNO, ARTICLE.ARTNAME,  GrpMst.GrpSubDesc  FROM     ARTICLE INNER JOIN GrpMst ON ARTICLE.ARTSECTIONID = GrpMst.GrpCode AND ARTICLE.ARTSBSECTIONID = GrpMst.GrpSubCode ");
             if (ds.Tables[0].Rows.Count > 0)
             {
                 HelpGrid.DataSource = ds.Tables[0];
                 HelpGridView.BestFitColumns();
                 HelpGrid.Show();
                 HelpGrid.Focus();
             }
         }
         else
         {
             DataSet ds = ProjectFunctions.GetDataSet("SELECT ARTICLE.ARTSYSID, ARTICLE.ARTNO, ARTICLE.ARTNAME,  GrpMst.GrpSubDesc  FROM     ARTICLE INNER JOIN GrpMst ON ARTICLE.ARTSECTIONID = GrpMst.GrpCode AND ARTICLE.ARTSBSECTIONID = GrpMst.GrpSubCode Where ARTICLE.ARTNO='" + txtArtNo.Text + "'");
             if (ds.Tables[0].Rows.Count > 0)
             {
                 txtArtNo.Text   = ds.Tables[0].Rows[0]["ARTNO"].ToString();
                 txtArtID.Text   = ds.Tables[0].Rows[0]["ARTSYSID"].ToString();
                 txtArtDesc.Text = ds.Tables[0].Rows[0]["GrpSubDesc"].ToString();
                 LoadProductionOrderColorAndSize();
                 txtSampleWeight.Focus();
             }
             else
             {
                 DataSet ds1 = ProjectFunctions.GetDataSet("SELECT ARTICLE.ARTSYSID, ARTICLE.ARTNO, ARTICLE.ARTNAME,  GrpMst.GrpSubDesc  FROM     ARTICLE INNER JOIN GrpMst ON ARTICLE.ARTSECTIONID = GrpMst.GrpCode AND ARTICLE.ARTSBSECTIONID = GrpMst.GrpSubCode ");
                 if (ds1.Tables[0].Rows.Count > 0)
                 {
                     HelpGrid.DataSource = ds1.Tables[0];
                     HelpGridView.BestFitColumns();
                     HelpGrid.Show();
                     HelpGrid.Focus();
                 }
             }
         }
     }
 }
Example #18
0
        private void BtnLoad_Click(object sender, EventArgs e)
        {
            HelpGridView.Columns.Clear();
            HelpGrid.Text = "Load";
            DataSet ds = ProjectFunctions.GetDataSet("select [GENERIC ART] from PISourceData");

            if (ds.Tables[0].Rows.Count > 0)
            {
                //dt = ds.Tables[0];
                HelpGrid.DataSource = ds.Tables[0];
                HelpGridView.BestFitColumns();
                HelpGrid.Visible = true;
                HelpGrid.Show();
                HelpGrid.Focus();
            }
            else
            {
                HelpGrid.DataSource = null;
            }
        }
Example #19
0
        private void Txt_DealerCode_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                HelpGrid.Text       = "Dealer";
                HelpGrid.DataSource = null;
                HelpGridView.Columns.Clear();

                if (Txt_DealerCode.Text.Length == 0)
                {
                    var ds = ProjectFunctions.GetDataSet(string.Format("sp_LoadAdvPenVouchers @Tag='Dealer' "));
                    HelpGrid.DataSource = ds.Tables[0];
                    HelpGridView.BestFitColumns();
                    HelpGrid.Visible = true;
                    HelpGrid.Focus();
                }
                else
                {
                    var       ds  = ProjectFunctions.GetDataSet(string.Format("sp_LoadAdvPenVouchers @Tag='Dealer' ", Txt_DealerCode.Text));
                    DataRow[] drr = ds.Tables[0].Select(string.Format("DealerCode='{0}'", Txt_DealerCode.Text));
                    if (drr.Count() > 0)
                    {
                        Txt_Dealer.Text         = drr[0]["DealerName"].ToString();
                        Txt_DealerCode.Text     = drr[0]["DealerCode"].ToString();
                        Txt_AdvVoucherNo.Text   = string.Empty;
                        Txt_AdvVoucherType.Text = string.Empty;
                        Txt_AdvAmt.Text         = string.Empty;
                        Txt_AdvVoucherNo.Focus();
                    }
                    else
                    {
                        var ds1 = ProjectFunctions.GetDataSet("sp_LoadAdvPenVouchers @Tag='Dealer' ");
                        HelpGrid.DataSource = ds1.Tables[0];
                        HelpGridView.BestFitColumns();
                        HelpGrid.Visible = true;
                        HelpGrid.Focus();
                    }
                }
            }
            e.Handled = true;
        }
Example #20
0
        private void FillPartyGrid()
        {
            DataSet ds = ProjectFunctions.GetDataSet("Select AccCode,AccName from ActMst where  AccActive='y' order by AccName ");

            if (ds.Tables[0].Rows.Count > 0)
            {
                ds.Tables[0].Columns.Add("Select", typeof(bool));
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    dr["Select"] = false;
                }
                PrepareActMstHelpGrid();
                HelpGrid.DataSource = ds.Tables[0];
                HelpGridView.BestFitColumns();
            }
            else
            {
                HelpGrid.DataSource = null;
                HelpGridView.BestFitColumns();
            }
        }
 private void txtCityCodeNew_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         HelpGridView.Columns.Clear();
         HelpGrid.Text = "txtCityCodeNew";
         DataSet ds = ProjectFunctions.GetDataSet("Select StateCode,DistCode,CityCode,StateDesc,DistDesc,CityDesc from StateMst");
         if (ds.Tables[0].Rows.Count > 0)
         {
             HelpGrid.DataSource = ds.Tables[0];
             HelpGrid.Visible    = true;
             HelpGrid.Focus();
             HelpGridView.BestFitColumns();
         }
         else
         {
             ProjectFunctions.SpeakError("No Records To Display");
         }
     }
     e.Handled = true;
 }
Example #22
0
        private void FillBSGrid()
        {
            DataSet ds = ProjectFunctions.GetDataSet("Select BSCode,BSDesc from bshmst order by BSDesc");

            if (ds.Tables[0].Rows.Count > 0)
            {
                ds.Tables[0].Columns.Add("Select", typeof(bool));
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    dr["Select"] = false;
                }
                PrepareBSHMstHelpGrid();
                HelpGrid.DataSource = ds.Tables[0];
                HelpGridView.BestFitColumns();
            }
            else
            {
                HelpGrid.DataSource = null;
                HelpGridView.BestFitColumns();
            }
        }
        private void TxtSearchBox_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                HelpGrid.Show();

                if (HelpGrid.Text == "AccCode")
                {
                    DataTable dtNew = dsPopUps.Tables[0].Clone();
                    DataRow[] dtRow = dsPopUps.Tables[0].Select("AccName like '" + txtSearchBox.Text + "%'");
                    foreach (DataRow dr in dtRow)
                    {
                        DataRow NewRow = dtNew.NewRow();
                        NewRow["AccCode"] = dr["AccCode"];
                        NewRow["AccName"] = dr["AccName"];


                        dtNew.Rows.Add(NewRow);
                    }
                    if (dtNew.Rows.Count > 0)
                    {
                        HelpGridView.Columns.Clear();
                        HelpGrid.DataSource = dtNew;
                        HelpGridView.BestFitColumns();
                    }
                    else
                    {
                        HelpGrid.DataSource = null;
                        HelpGridView.BestFitColumns();
                    }
                }
            }

            catch (Exception)
            {
            }
        }
Example #24
0
 private void BtnImportBarCodeForBranch_Click(object sender, EventArgs e)
 {
     try
     {
         HelpGridView.Columns.Clear();
         HelpGrid.Text = "Load";
         DataSet ds = ProjectFunctions.GetDataSet("sp_LoadDataFSKUFromHO '" + GlobalVariables.CUnitID + "'");
         if (ds.Tables[0].Rows.Count > 0)
         {
             ds.Tables[0].Columns.Add("Select", typeof(bool));
             foreach (DataRow dr in ds.Tables[0].Rows)
             {
                 dr["Select"] = false;
             }
             HelpGrid.DataSource = ds.Tables[0];
             HelpGrid.Show();
             HelpGrid.Focus();
             HelpGridView.BestFitColumns();
             HelpGridView.OptionsBehavior.Editable = true;
             foreach (DevExpress.XtraGrid.Columns.GridColumn col in HelpGridView.Columns)
             {
                 if (col.FieldName == "Select")
                 {
                     col.OptionsColumn.AllowEdit = true;
                 }
                 else
                 {
                     col.OptionsColumn.AllowEdit = false;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ProjectFunctions.SpeakError(ex.Message);
     }
 }
Example #25
0
        private void Txt_AdvVoucherNo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                HelpGrid.Text = "Advance";
                // if (Txt_AdvVoucherNo.Text.Length == 0)
                {
                    HelpGrid.DataSource = null;
                    HelpGridView.Columns.Clear();
                    var ds = ProjectFunctions.GetDataSet(string.Format("sp_LoadAdvPenVouchers @Tag='AdvRef',@DlrCode='{0}'", Txt_DealerCode.Text));
                    HelpGrid.DataSource = ds.Tables[0];
                    HelpGridView.BestFitColumns();
                    HelpGrid.Visible = true;
                    HelpGrid.Focus();
                }
                //else
                //{
                //    var ds = ProjectFunctions.GetDataSet("select distinct DeptDesc,DeptCode from deptnewmst  Where DeptCode='" + txtFDRCode.Text + "'");
                //    if (ds.Tables[0].Rows.Count > 0)
                //    {
                //        Txt_AdvVoucherNo.Text = ds.Tables[0].Rows[0]["DeptCode"].ToString();
                //        Txt_AdvVoucherNo.Text = ds.Tables[0].Rows[0]["DeptDesc"].ToString();

                //        Txt_AdvVoucherNo.Focus();
                //    }
                //    else
                //    {
                //        var ds1 = ProjectFunctions.GetDataSet("select distinct DeptDesc,DeptCode from deptnewmst order by DeptDesc  ");
                //        HelpGrid.DataSource = ds1.Tables[0];
                //        HelpGridView.BestFitColumns();
                //        HelpGrid.Visible = true;
                //        HelpGrid.Focus();
                //    }
                //  }
            }
            e.Handled = true;
        }
Example #26
0
        private void TxtSearchBox_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                HelpGrid.Show();

                if (HelpGrid.Text == "txtVoucherTypeCode")
                {
                    DataTable dtNew = dsPopUps.Tables[0].Clone();
                    DataRow[] dtRow = dsPopUps.Tables[0].Select("VouDesc like '" + txtSearchBox.Text + "%'");
                    foreach (DataRow dr in dtRow)
                    {
                        DataRow NewRow = dtNew.NewRow();
                        NewRow["VouCode"] = dr["VouCode"];
                        NewRow["VouDesc"] = dr["VouDesc"];


                        dtNew.Rows.Add(NewRow);
                    }
                    if (dtNew.Rows.Count > 0)
                    {
                        HelpGridView.Columns.Clear();
                        HelpGrid.DataSource = dtNew;
                        HelpGridView.BestFitColumns();
                    }
                    else
                    {
                        HelpGrid.DataSource = null;
                        HelpGridView.BestFitColumns();
                    }
                }

                if (HelpGrid.Text == "txtAccountCode")
                {
                    DataTable dtNew = new DataTable();
                    DataRow[] dtRow;

                    if (txtVoucherTypeCode.Text.Trim() == "BR" || txtVoucherTypeCode.Text.Trim() == "BP")
                    {
                        dtNew = dsPopUps.Tables[2].Clone();
                        dtRow = dsPopUps.Tables[2].Select("AccName like '" + txtSearchBox.Text + "%'");
                    }
                    else
                    {
                        if (txtVoucherTypeCode.Text.Trim() == "CR" || txtVoucherTypeCode.Text.Trim() == "CP")
                        {
                            dtNew = dsPopUps.Tables[3].Clone();
                            dtRow = dsPopUps.Tables[3].Select("AccName like '" + txtSearchBox.Text + "%'");
                        }
                        else
                        {
                            dtNew = dsPopUps.Tables[1].Clone();
                            dtRow = dsPopUps.Tables[1].Select("AccName like '" + txtSearchBox.Text + "%'");
                        }
                    }


                    foreach (DataRow dr in dtRow)
                    {
                        DataRow NewRow = dtNew.NewRow();
                        NewRow["AccCode"] = dr["AccCode"];
                        NewRow["AccName"] = dr["AccName"];
                        dtNew.Rows.Add(NewRow);
                    }
                    if (dtNew.Rows.Count > 0)
                    {
                        HelpGridView.Columns.Clear();
                        HelpGrid.DataSource = dtNew;
                        HelpGridView.BestFitColumns();
                    }
                    else
                    {
                        HelpGrid.DataSource = null;
                        HelpGridView.BestFitColumns();
                    }
                }

                if (HelpGrid.Text == "AccCode")
                {
                    DataTable dtNew = dsPopUps.Tables[1].Clone();
                    DataRow[] dtRow = dsPopUps.Tables[1].Select("AccName like '" + txtSearchBox.Text + "%'");
                    foreach (DataRow dr in dtRow)
                    {
                        DataRow NewRow = dtNew.NewRow();
                        NewRow["AccCode"] = dr["AccCode"];
                        NewRow["AccName"] = dr["AccName"];
                        dtNew.Rows.Add(NewRow);
                    }
                    if (dtNew.Rows.Count > 0)
                    {
                        HelpGridView.Columns.Clear();
                        HelpGrid.DataSource = dtNew;
                        HelpGridView.BestFitColumns();
                    }
                    else
                    {
                        HelpGrid.DataSource = null;
                        HelpGridView.BestFitColumns();
                    }
                }
            }

            catch (Exception)
            {
            }
        }
Example #27
0
        private void TxtBarCode_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.F3)
                {
                    HelpGridView.Columns.Clear();
                    HelpGrid.Text = "Load";


                    DataTable dtNew = new DataTable();


                    DataSet ds = ProjectFunctions.GetDataSet("sp_LoadDataFromSFDet_F3 '" + GlobalVariables.CUnitID + "'");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        ds.Tables[0].Columns.Add("Select", typeof(bool));
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            dr["Select"] = false;
                            foreach (DataRow drdt in dt.Rows)
                            {
                                if (dr["SIDBARCODE"].ToString() == drdt["SIDBARCODE"].ToString())
                                {
                                    dr["Select"] = true;
                                    continue;
                                }
                            }
                        }
                        dtNew = ds.Tables[0].Clone();

                        foreach (DataRow drNewRow in ds.Tables[0].Select("Select=False"))
                        {
                            dtNew.ImportRow(drNewRow);
                        }



                        HelpGrid.DataSource = dtNew;
                        HelpGrid.Show();
                        HelpGrid.Focus();
                        HelpGridView.BestFitColumns();

                        HelpGridView.OptionsBehavior.Editable = true;
                        foreach (DevExpress.XtraGrid.Columns.GridColumn col in HelpGridView.Columns)
                        {
                            if (col.FieldName == "Select")
                            {
                                col.VisibleIndex            = 0;
                                col.OptionsColumn.AllowEdit = true;
                            }
                            else
                            {
                                col.OptionsColumn.AllowEdit = false;
                            }
                        }
                    }
                }
                if (e.KeyCode == Keys.Enter)
                {
                    DataSet ds = ProjectFunctions.GetDataSet("sp_LoadDataFromSKUdetUsingBarCode '" + txtBarCode.Text + "','" + GlobalVariables.CUnitID + "'");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["Used"].ToString().ToUpper() == "Y")
                        {
                            ProjectFunctions.SpeakError("BarCode Already Used In Some Other Document");
                            txtBarCode.Focus();
                            txtBarCode.SelectAll();
                            e.Handled = true;
                            return;
                        }
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["SIDBARCODE"].ToString().ToUpper() == txtBarCode.Text.Trim())
                            {
                                ProjectFunctions.SpeakError("BarCode Already Loaded In This Document");
                                txtBarCode.Focus();
                                txtBarCode.SelectAll();
                                e.Handled = true;
                                return;
                            }
                        }
                        if (Convert.ToDecimal(ds.Tables[0].Rows[0]["SIDARTMRP"]) != Convert.ToDecimal(ds.Tables[0].Rows[0]["ARTMRP"]))
                        {
                            ProjectFunctions.SpeakError("Difference In MRP( MRP In Article is - " + ds.Tables[0].Rows[0]["ARTMRP"].ToString() + ")");
                            txtBarCode.Focus();
                            txtBarCode.SelectAll();
                            e.Handled = true;
                            return;
                        }



                        if (dt.Rows.Count == 0)
                        {
                            dt = ds.Tables[0];
                        }
                        else
                        {
                            dt.Merge(ds.Tables[0]);
                        }

                        ShowImage(Convert.ToDecimal(ds.Tables[0].Rows[0]["SIDARTID"]).ToString());
                    }
                    else
                    {
                        ProjectFunctions.SpeakError("NO BarCode Found");
                        return;
                    }
                    if (dt.Rows.Count > 0)
                    {
                        InfoGrid.DataSource = dt;
                        InfoGridView.BestFitColumns();
                    }
                    else
                    {
                        InfoGrid.DataSource = null;
                    }
                    txtBarCode.Text = string.Empty;
                    txtBarCode.Focus();
                }
            }
            catch (Exception ex)
            {
                ProjectFunctions.SpeakError(ex.Message);
            }
            e.Handled = true;
        }