예제 #1
0
        private void SaveLocationMaster()
        {
            LocationMaster oclsLocationMaster = null;

            try
            {
                oclsLocationMaster                  = new LocationMaster();
                oclsLocationMaster.nLocationID      = Convert.ToInt64(lblLocationID.Text);
                oclsLocationMaster.sLocationCode    = Convert.ToString(txtCode.Text.Trim());
                oclsLocationMaster.sDescription     = Convert.ToString(txtDescription.Text.Trim());
                oclsLocationMaster.sAddressLine1    = Convert.ToString(txtAddressLine1.Text.Trim());
                oclsLocationMaster.sAddressLine2    = Convert.ToString(txtAddressLine2.Text.Trim());
                oclsLocationMaster.sCity            = Convert.ToString(txtCity.Text.Trim());
                oclsLocationMaster.sState           = Convert.ToString(txtState.Text.Trim());
                oclsLocationMaster.sCountry         = Convert.ToString(txtCountry.Text.Trim());
                oclsLocationMaster.sPincode         = Convert.ToString(txtPincode.Text.Trim());
                oclsLocationMaster.sVillageDistTown = Convert.ToString(txtVilageDistTown.Text.Trim());

                Int64 nLocationID = oclsLocationMaster.InsertUpdateLocationMaster();

                if (nLocationID != 0)
                {
                    MessageBox.Show("Location is saved successfully.", clsGlobal.MessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ClearControl();
                }
                else
                {
                    MessageBox.Show("Error while saving location.", clsGlobal.MessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #2
0
        private void FillLocatioDetails(long nLocationID)
        {
            LocationMaster oLocationMaster   = null;
            DataTable      dtLocationDetails = null;

            try
            {
                oLocationMaster   = new LocationMaster();
                dtLocationDetails = oLocationMaster.GetLocationInformation(nLocationID);

                if (dtLocationDetails != null && dtLocationDetails.Rows.Count > 0)
                {
                    lblLocationID.Text     = Convert.ToString(dtLocationDetails.Rows[0]["nLocationID"]);
                    txtCode.Text           = Convert.ToString(dtLocationDetails.Rows[0]["sLocationCode"]);
                    txtDescription.Text    = Convert.ToString(dtLocationDetails.Rows[0]["sDescription"]);
                    txtAddressLine1.Text   = Convert.ToString(dtLocationDetails.Rows[0]["sAddressLine1"]);
                    txtAddressLine2.Text   = Convert.ToString(dtLocationDetails.Rows[0]["sAddressLine2"]);
                    txtCity.Text           = Convert.ToString(dtLocationDetails.Rows[0]["sCity"]);
                    txtState.Text          = Convert.ToString(dtLocationDetails.Rows[0]["sState"]);
                    txtCountry.Text        = Convert.ToString(dtLocationDetails.Rows[0]["sCountry"]);
                    txtPincode.Text        = Convert.ToString(dtLocationDetails.Rows[0]["sPincode"]);
                    txtVilageDistTown.Text = Convert.ToString(dtLocationDetails.Rows[0]["sVlgDstTwn"]);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void FillLocationMasterList()
        {
            LocationMaster clsLocationMaster = null;
            DataTable      dt = null;

            try
            {
                clsLocationMaster = new LocationMaster();
                dt = clsLocationMaster.GetLocationlist(0);

                if (dt != null)
                {
                    gvLocationList.GridControl.DataSource = dt;
                    gvLocationList.Columns[1].Visible     = false;
                    gvLocationList.Columns[8].Visible     = false;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }