コード例 #1
0
 private void BankMaster_Load(object sender, EventArgs e)
 {
     try
     {
         //txtBankName.AutoCompleteSource = AutoCompleteSource.CustomSource;
         //txtBankName.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
         //AutoCompleteStringCollection daColl = new AutoCompleteStringCollection();
         objDB = new SQLDB();
         DataTable dtBankMas  = objDB.ExecuteDataSet("SELECT DISTINCT BIM_BANK_NAME FROM BANK_IFSC_MICR_MAS ORDER BY BIM_BANK_NAME").Tables[0];
         DataTable dtStateMas = objDB.ExecuteDataSet("SELECT DISTINCT BIM_STATE FROM BANK_IFSC_MICR_MAS ORDER BY BIM_STATE").Tables[0];
         DataTable dtIFSC     = objDB.ExecuteDataSet("SELECT DISTINCT BIM_BANK_IFSC_CODE FROM BANK_IFSC_MICR_MAS").Tables[0];
         //string[] postSource = dt
         //        .AsEnumerable()
         //        .Select<System.Data.DataRow, String>(x => x.Field<String>("BIM_BANK_NAME"))
         //        .ToArray();
         //var source = new AutoCompleteStringCollection();
         //source.AddRange(postSource);
         //txtBankName.AutoCompleteCustomSource = source;
         //txtBankName.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
         //txtBankName.AutoCompleteSource = AutoCompleteSource.CustomSource;
         UtilityLibrary.AutoCompleteTextBox(txtBankName, dtBankMas, "", "BIM_BANK_NAME");
         UtilityLibrary.AutoCompleteTextBox(txtState, dtStateMas, "", "BIM_STATE");
         UtilityLibrary.AutoCompleteTextBox(txtIFSC, dtIFSC, "", "BIM_BANK_IFSC_CODE");
     }
     catch { }
     finally { objDB = null; }
     dtpTo.Value = DateTime.Now;
 }
コード例 #2
0
        private void FillMajorCostNames()
        {
            string strCommand = "";

            try
            {
                objSqlDB   = new SQLDB();
                strCommand = "SELECT MCC_MAJOR_COST_CENTRE_ID,MCC_MAJOR_COST_CENTRE_NAME FROM FA_MAJOR_COST_CENTRE where mcc_company_code='" + CommonData.CompanyCode + "'";
                DataTable dtCCNameDetails = objSqlDB.ExecuteDataSet(strCommand).Tables[0];
                UtilityLibrary.AutoCompleteTextBox(txtMajorCostCenterName, dtCCNameDetails, "", "MCC_MAJOR_COST_CENTRE_NAME");
                objSqlDB = null;

                strCommand = "";
                objSqlDB   = new SQLDB();
                strCommand = "SELECT MCC_MAJOR_COST_CENTRE_ID,MCC_SHORT_NAME FROM FA_MAJOR_COST_CENTRE where mcc_company_code='" + CommonData.CompanyCode + "'";

                DataTable dtCCSNameDetails = objSqlDB.ExecuteDataSet(strCommand).Tables[0];

                UtilityLibrary.AutoCompleteTextBox(txtMajorCostCenterSName, dtCCSNameDetails, "", "MCC_SHORT_NAME");
                objSqlDB = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objSqlDB = null;
            }
        }
コード例 #3
0
        private void FillAutoCompleteBox()
        {
            objDB = new SQLDB();
            DataTable dtAccMas = new DataTable();

            dtAccMas = objDB.ExecuteDataSet(" SELECT AM_ACCOUNT_ID,AM_ACCOUNT_NAME AccName FROM FA_ACCOUNT_MASTER  WHERE AM_COMPANY_CODE='" + CommonData.CompanyCode + "' AND AM_ACCOUNT_GROUP_ID IS NULL ").Tables[0];
            UtilityLibrary.AutoCompleteTextBox(txtAccountSearch, dtAccMas, "AM_ACCOUNT_ID", "AM_ACCOUNT_ID");

            DataTable dtAccName = new DataTable();

            dtAccName = objDB.ExecuteDataSet(" SELECT AM_ACCOUNT_ID,AM_ACCOUNT_NAME AccName FROM FA_ACCOUNT_MASTER  WHERE AM_COMPANY_CODE='" + CommonData.CompanyCode + "' AND AM_ACCOUNT_GROUP_ID IS NULL ").Tables[0];
            UtilityLibrary.AutoCompleteTextBox(txtName, dtAccName, "", "AccName");
        }
コード例 #4
0
 private void txtBankName_Validated(object sender, EventArgs e)
 {
     try
     {
         objDB = new SQLDB();
         DataTable dtBranchMas = objDB.ExecuteDataSet("SELECT DISTINCT BIM_BRANCH_NAME FROM BANK_IFSC_MICR_MAS " +
                                                      "WHERE BIM_BANK_NAME = '" + txtBankName.Text +
                                                      "' ORDER BY BIM_BRANCH_NAME").Tables[0];
         UtilityLibrary.AutoCompleteTextBox(txtBankBranch, dtBranchMas, "", "BIM_BRANCH_NAME");
         objDB = null;
     }
     catch { }
     finally { objDB = null; }
 }
コード例 #5
0
        private void frmEmpAwardsEntry_Load(object sender, EventArgs e)
        {
            txtEventName.Visible = false;
            chkAddEvent.Checked  = false;
            btnAdd.Visible       = false;

            dtpAwardDate.Value = DateTime.Today;
            FillFinYear();
            FillCompanyData();
            cbFinYear.SelectedValue = CommonData.FinancialYear;
            FillEventDetails();


            try
            {
                objSQLdb = new SQLDB();
                DataTable dt = objSQLdb.ExecuteDataSet("SELECT DISTINCT HEA_AWARD_TYPE " +
                                                       " FROM HR_APPL_EMP_AWARDS_REWARDS " +
                                                       " ORDER BY HEA_AWARD_TYPE asc").Tables[0];
                UtilityLibrary.AutoCompleteTextBox(txtAwardType, dt, "", "HEA_AWARD_TYPE");
                objSQLdb = null;
            }
            catch { }
            finally { objSQLdb = null; }

            try
            {
                objSQLdb = new SQLDB();
                DataTable dt = objSQLdb.ExecuteDataSet("SELECT DISTINCT HEA_AWARD_NAME " +
                                                       " FROM HR_APPL_EMP_AWARDS_REWARDS " +
                                                       " ORDER BY HEA_AWARD_NAME asc").Tables[0];
                UtilityLibrary.AutoCompleteTextBox(txtAwardName, dt, "", "HEA_AWARD_NAME");
                objSQLdb = null;
            }
            catch { }
            finally { objSQLdb = null; }
        }
コード例 #6
0
        private void FillStationaryItemDetailsToGrid(string CatageoriId, string CompCode, string State, string BranchCode)
        {
            gvIndentDetails.Rows.Clear();
            objSQLDB = new SQLDB();
            DataTable dtItems = null;

            try
            {
                dtItems = Get_Stationary_Item_Details(CatageoriId, CompCode, State, BranchCode);
                if (dtItems.Rows.Count > 0)
                {
                    UtilityLibrary.AutoCompleteTextBox(txtItemDesc, dtItems, "", "st_item_name");
                    for (int i = 0; i < dtItems.Rows.Count; i++)

                    {
                        DataGridViewRow  tempRow  = new DataGridViewRow();
                        DataGridViewCell cellSLNO = new DataGridViewTextBoxCell();
                        cellSLNO.Value = (i + 1).ToString();
                        tempRow.Cells.Add(cellSLNO);

                        DataGridViewCell cellItemCompany = new DataGridViewTextBoxCell();
                        cellItemCompany.Value = dtItems.Rows[i]["st_company_code"].ToString();
                        tempRow.Cells.Add(cellItemCompany);

                        DataGridViewCell cellItemState = new DataGridViewTextBoxCell();
                        cellItemState.Value = dtItems.Rows[i]["st_state_code"].ToString();
                        tempRow.Cells.Add(cellItemState);

                        DataGridViewCell cellItemBranchCode = new DataGridViewTextBoxCell();
                        cellItemBranchCode.Value = dtItems.Rows[i]["st_branch_code"].ToString();
                        tempRow.Cells.Add(cellItemBranchCode);

                        DataGridViewCell cellItemID = new DataGridViewTextBoxCell();
                        cellItemID.Value = dtItems.Rows[i]["st_item_code"].ToString();
                        tempRow.Cells.Add(cellItemID);

                        DataGridViewCell cellItemCategory = new DataGridViewTextBoxCell();
                        cellItemCategory.Value = dtItems.Rows[i]["st_category"].ToString();
                        tempRow.Cells.Add(cellItemCategory);

                        DataGridViewCell cellItemCompanyName = new DataGridViewTextBoxCell();
                        cellItemCompanyName.Value = dtItems.Rows[i]["st_company_name"].ToString();
                        tempRow.Cells.Add(cellItemCompanyName);

                        DataGridViewCell cellItemStateName = new DataGridViewTextBoxCell();
                        cellItemStateName.Value = dtItems.Rows[i]["st_state_name"].ToString();
                        tempRow.Cells.Add(cellItemStateName);

                        DataGridViewCell cellItemBranchName = new DataGridViewTextBoxCell();
                        cellItemBranchName.Value = dtItems.Rows[i]["st_branch_name"].ToString();
                        tempRow.Cells.Add(cellItemBranchName);

                        DataGridViewCell cellItemName = new DataGridViewTextBoxCell();
                        cellItemName.Value = dtItems.Rows[i]["st_item_name"].ToString();
                        tempRow.Cells.Add(cellItemName);


                        //DataGridViewCell cellItemCategoryName = new DataGridViewTextBoxCell();
                        //cellItemCategoryName.Value = dtItems.Rows[i]["st_categoryName"].ToString();
                        //tempRow.Cells.Add(cellItemCategoryName);

                        DataGridViewCell cellItemPrice = new DataGridViewTextBoxCell();
                        cellItemPrice.Value = Convert.ToDouble(dtItems.Rows[i]["st_item_price"].ToString()).ToString("f");
                        tempRow.Cells.Add(cellItemPrice);

                        DataGridViewCell cellItemStatus = new DataGridViewTextBoxCell();
                        if (dtItems.Rows[i]["st_active"].ToString() == "T")
                        {
                            cellItemStatus.Value = "ACTIVE";
                        }
                        else
                        {
                            cellItemStatus.Value = "DEACTIVE";
                        }
                        //cellItemStatus.Value = dtItems.Rows[i]["SIM_ACTIVE"].ToString();

                        tempRow.Cells.Add(cellItemStatus);

                        gvIndentDetails.Rows.Add(tempRow);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dtItems  = null;
                objSQLDB = null;
            }
        }