private void fillMasterData()
        {
            txtCountry.Text = "India";
            txtCity.Text    = "Mumbai";
            txtState.Text   = "Maharashtra";
            clsGeneral oclsGeneral = null;

            try
            {
                oclsGeneral = new clsGeneral();
                DataSet dsParty = oclsGeneral.GetPartyMaster();
                if (dsParty != null && dsParty.Tables.Count > 0)
                {
                    DataTable dtPartyType = dsParty.Tables[0];
                    //DataTable dtStateMaster = dsParty.Tables[1];
                    //DataTable dtCityMaster = dsParty.Tables[2];
                    //DataTable dtCountryMaster = dsParty.Tables[3];

                    DataRow drParty = dtPartyType.NewRow();
                    drParty["nPartyTypeID"]   = 0;
                    drParty["sPartyTypeName"] = "";
                    dtPartyType.Rows.InsertAt(drParty, 0);

                    cmbPartyType.DataSource    = dtPartyType;
                    cmbPartyType.DisplayMember = "sPartyTypeName";
                    cmbPartyType.ValueMember   = "nPartyTypeID";

                    //cmbStateMaster.DataSource = dtStateMaster;
                    //cmbStateMaster.DisplayMember = "StateName";
                    //cmbStateMaster.ValueMember = "StateName";
                    //cmbStateMaster.Text = "Maharashtra";

                    //cmbCityMaster.DataSource = dtCityMaster;
                    //cmbCityMaster.DisplayMember = "CityName";
                    //cmbCityMaster.ValueMember = "CityName";
                    //cmbCityMaster.Text = "Mumbai";

                    //cmbCountryMaster.DataSource = dtCountryMaster;
                    //cmbCountryMaster.DisplayMember = "sCountryName";
                    //cmbCountryMaster.ValueMember = "sCountryName";
                    //cmbCountryMaster.Text = "India";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                if (oclsGeneral != null)
                {
                    oclsGeneral.Dispose();
                    oclsGeneral = null;
                }
            }
        }
Exemplo n.º 2
0
        private void gvCompanyList_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                if (e.Column.Caption == "Edit")
                {
                    Int64 nCompanyID = 0;
                    var   row        = gvCrewList.GetFocusedDataRow();

                    nCompanyID = Convert.ToInt64(row[1]);
                    frmMasterAddCrew frmMaster = new frmMasterAddCrew(nCompanyID);
                    frmMaster.ShowDialog();
                    FillCrewMasterList();
                }
                if (e.Column.Caption == "Delete")
                {
                    var row = gvCrewList.GetFocusedDataRow();
                    int n   = Convert.ToString(gvCrewList.GetRowCellValue(e.RowHandle, "IsUsed")) == "" || Convert.ToString(gvCrewList.GetRowCellValue(e.RowHandle, "IsUsed")) == "0" ? 0 : 1;

                    if (n == 1)
                    {
                        return;
                    }
                    if (MessageBox.Show("Do you want to delete?", clsGlobal._sMessageboxCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                    clsGeneral oclsGeneral = new clsGeneral();
                    if (oclsGeneral.GetDeleteMasterType(MainMasterType.Crew.GetHashCode(), Convert.ToInt64(row[1])) > 0)
                    {
                        MessageBox.Show("Crew member details deleted successfully.", clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    if (oclsGeneral != null)
                    {
                        oclsGeneral.Dispose();
                        oclsGeneral = null;
                    }
                    //clsMasters oclsMaster = new clsMasters();
                    //oclsMaster.nMasterID = Convert.ToInt64(row[1]);
                    //oclsMaster.MasterType = this.MasterType;
                    //oclsMaster.DeleteMaster();
                    FillCrewMasterList();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void GetAndSetSequence()
        {
            clsGeneral oclsGeneral = null;

            try
            {
                oclsGeneral       = new clsGeneral();
                txtPartyCode.Text = "PRT/" + Convert.ToString(oclsGeneral.GetSequenceNumber(MainMasterType.Party.GetHashCode()));
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                if (oclsGeneral != null)
                {
                    oclsGeneral.Dispose();
                    oclsGeneral = null;
                }
            }
        }
Exemplo n.º 4
0
        private void GetAndSetSequence()
        {
            clsGeneral oclsGeneral = null;

            try
            {
                oclsGeneral     = new clsGeneral();
                txtKitCode.Text = "KIT/" + Convert.ToString(oclsGeneral.GetSequenceNumber_Transaction(TransactionType.Kit));
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                if (oclsGeneral != null)
                {
                    oclsGeneral.Dispose();
                    oclsGeneral = null;
                }
            }
        }
        private void fillMasterData()
        {
            txtCountry.Text = "India";
            txtCity.Text    = "Mumbai";
            txtState.Text   = "Maharashtra";
            clsGeneral oclsGeneral = null;

            try
            {
                oclsGeneral = new clsGeneral();
                DataSet dsCrew = oclsGeneral.GetCrewMaster();
                if (dsCrew != null && dsCrew.Tables.Count > 0)
                {
                    DataTable dtCompanyType = dsCrew.Tables[0];
                    //DataTable dtStateMaster = dsCrew.Tables[1];
                    //DataTable dtCityMaster = dsCrew.Tables[2];
                    //DataTable dtCountryMaster = dsCrew.Tables[3];
                    DataTable dtDesignation = dsCrew.Tables[4];

                    DataRow drComp = dtCompanyType.NewRow();
                    drComp["nCompanyID"]   = 0;
                    drComp["sCompanyName"] = "";
                    dtCompanyType.Rows.InsertAt(drComp, 0);

                    DataRow drDesg = dtDesignation.NewRow();
                    drDesg["nDesignationID"]   = 0;
                    drDesg["sDesignationName"] = "";
                    drDesg["SettingStatus"]    = 0;
                    dtDesignation.Rows.InsertAt(drDesg, 0);

                    cmbEmpCompany.DataSource    = dtCompanyType;
                    cmbEmpCompany.DisplayMember = "sCompanyName";
                    cmbEmpCompany.ValueMember   = "nCompanyID";

                    //cmbStateMaster.DataSource = dtStateMaster;
                    //cmbStateMaster.DisplayMember = "StateName";
                    //cmbStateMaster.ValueMember = "StateName";
                    //cmbStateMaster.Text = "Maharashtra";

                    //cmbCityMaster.DataSource = dtCityMaster;
                    //cmbCityMaster.DisplayMember = "CityName";
                    //cmbCityMaster.ValueMember = "CityName";
                    //cmbCityMaster.Text = "Mumbai";

                    //cmbCountryMaster.DataSource = dtCountryMaster;
                    //cmbCountryMaster.DisplayMember = "sCountryName";
                    //cmbCountryMaster.ValueMember = "sCountryName";
                    //cmbCountryMaster.Text = "India";

                    cmbEmpDesignation.SelectedIndexChanged -= cmbEmpDesignation_SelectedIndexChanged;
                    cmbEmpDesignation.DataSource            = dtDesignation;
                    cmbEmpDesignation.DisplayMember         = "sDesignationName";
                    cmbEmpDesignation.ValueMember           = "nDesignationID";
                    cmbEmpDesignation.SelectedIndexChanged += cmbEmpDesignation_SelectedIndexChanged;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                if (oclsGeneral != null)
                {
                    oclsGeneral.Dispose();
                    oclsGeneral = null;
                }
            }
        }