public void BindAcmSuppliers()
 {
     try
     {
         BALandSuppliers objBalandSuppliers = new BALandSuppliers();
         int             landSupId          = 0;
         DataSet         datasetland        = new DataSet();
         datasetland = objBalandSuppliers.GetLandSupplier(landSupId);
         if (datasetland.Tables[0].Rows.Count > 0)
         {
             DDLACMSupplier.DataSource     = datasetland.Tables[0];
             DDLACMSupplier.DataTextField  = "LSupplierName";
             DDLACMSupplier.DataValueField = "LSupplierId";
             DDLACMSupplier.DataBind();
             DDLACMSupplier.Items.Insert(0, new ListItem("--Select Supplier--", "0"));
         }
         else
         {
             DDLACMSupplier.DataSource = null;
             DDLACMSupplier.DataBind();
             DDLACMSupplier.Items.Insert(0, new ListItem("--Select Supplier--", "0"));
         }
     }
     catch (Exception ex)
     {
         lblMsg.Text = _objBOUtiltiy.ShowMessage("danger", "Danger", ex.Message);
     }
 }
    private void BindLandSupplierList()
    {
        try
        {
            gvLandSupplierList.PageSize = int.Parse(ViewState["ps"].ToString());
            int     LSupplierId = 0;
            DataSet ds          = objLandSuppliers.GetLandSupplier(LSupplierId);
            Session["dt"] = ds.Tables[0];
            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                gvLandSupplierList.DataSource = ds.Tables[0];
                string sortDirection = "ASC", sortExpression;
                if (ViewState["so"] != null)
                {
                    sortDirection = ViewState["so"].ToString();
                }
                if (ViewState["se"] != null)
                {
                    sortExpression = ViewState["se"].ToString();
                    ds.Tables[0].DefaultView.Sort = sortExpression + " " + sortDirection;
                }
                gvLandSupplierList.DataBind();
            }

            else
            {
                gvLandSupplierList.DataSource = null;
                gvLandSupplierList.DataBind();

                Label lblEmptyMessage = gvLandSupplierList.Controls[0].Controls[0].FindControl("lblEmptyMessage") as Label;
                lblEmptyMessage.Text = "Currently there are no records in System";
            }
        }

        catch (Exception ex)
        {
            lblMsg.Text = _BOUtility.ShowMessage("danger", "Danger", ex.Message);
            ExceptionLogging.SendExcepToDB(ex);
        }
    }
Example #3
0
    private void GetLandSuppliers(int LSupplierId)
    {
        try
        {
            objEmLandSupp.LSupplierId = LSupplierId;
            DataSet objds = objLandSuppliers.GetLandSupplier(LSupplierId);

            if (objds.Tables[0].Rows.Count > 0)
            {
                hf_LSupplierId.Value = objds.Tables[0].Rows[0]["LSupplierId"].ToString();

                txtAccountCode.Text           = objds.Tables[0].Rows[0]["LSupAccountCode"].ToString();
                txtSupplierName.Text          = objds.Tables[0].Rows[0]["LSupplierName"].ToString();
                dropStatus.SelectedIndex      = dropStatus.Items.IndexOf(dropStatus.Items.FindByValue(objds.Tables[0].Rows[0]["LIsActive"].ToString()));
                dropServiceType.SelectedIndex = dropServiceType.Items.IndexOf(dropServiceType.Items.FindByValue(objds.Tables[0].Rows[0]["LServiceType"].ToString()));
                dropCountry.SelectedIndex     = dropCountry.Items.IndexOf(dropCountry.Items.FindByValue(objds.Tables[0].Rows[0]["LCountry"].ToString()));
                Get_State_Country();
                dropState.SelectedIndex = dropState.Items.IndexOf(dropState.Items.FindByValue(objds.Tables[0].Rows[0]["LStateId"].ToString()));
                Get_City_State();
                dropCity.SelectedIndex       = dropCity.Items.IndexOf(dropCity.Items.FindByValue(objds.Tables[0].Rows[0]["LCity"].ToString()));
                dropDivision.SelectedIndex   = dropDivision.Items.IndexOf(dropDivision.Items.FindByValue(objds.Tables[0].Rows[0]["LDivision"].ToString()));
                dropConsultant.SelectedIndex = dropConsultant.Items.IndexOf(dropConsultant.Items.FindByValue(objds.Tables[0].Rows[0]["LConsultant"].ToString()));

                txtLatitude.Text  = objds.Tables[0].Rows[0]["LLatitute"].ToString();
                txtLongitude.Text = objds.Tables[0].Rows[0]["LLongitude"].ToString();

                txtTelephoneNo.Text     = objds.Tables[0].Rows[0]["LTelephone"].ToString();
                txtFax.Text             = objds.Tables[0].Rows[0]["LFax"].ToString();
                txtCellNo.Text          = objds.Tables[0].Rows[0]["LCellNo"].ToString();
                txtContact.Text         = objds.Tables[0].Rows[0]["LContactNo"].ToString();
                txtEmail.Text           = objds.Tables[0].Rows[0]["LEmail"].ToString();
                txtWeb.Text             = objds.Tables[0].Rows[0]["LWeb"].ToString();
                txtPhysicalAddress.Text = objds.Tables[0].Rows[0]["LPhysicalAddress"].ToString();
                txtPostalAddress.Text   = objds.Tables[0].Rows[0]["LPostalAddress"].ToString();


                if (Convert.ToInt32(objds.Tables[0].Rows[0]["LNoVatNo"].ToString()) == 1)
                {
                    chkVATNO.Checked    = Convert.ToBoolean(objds.Tables[0].Rows[0]["LNoVatNo"]);
                    txtVATRegNo.Enabled = false;
                }
                else
                {
                    txtVATRegNo.Text = objds.Tables[0].Rows[0]["LVatRegNo"].ToString().Trim();
                }

                txtExtAcc.Text = objds.Tables[0].Rows[0]["LExtAcc"].ToString();

                txtIataReg.Text    = objds.Tables[0].Rows[0]["LIATAReg"].ToString();
                txtAlphaCode.Text  = objds.Tables[0].Rows[0]["LAlphaCode"].ToString();
                txtAmadeus.Text    = objds.Tables[0].Rows[0]["LAmadeus"].ToString();
                txtGalileo.Text    = objds.Tables[0].Rows[0]["LGalileo"].ToString();
                txtSabre.Text      = objds.Tables[0].Rows[0]["LSabre"].ToString();
                txtWorldSpan.Text  = objds.Tables[0].Rows[0]["LWorldSpan"].ToString();
                txtCarHire.Text    = objds.Tables[0].Rows[0]["LCarHire"].ToString();
                txtFrontDesk.Text  = objds.Tables[0].Rows[0]["LFrontDesk"].ToString();
                txtPropertyNo.Text = objds.Tables[0].Rows[0]["LOtherPropertyNo"].ToString();

                dropBank.SelectedIndex        = dropBank.Items.IndexOf(dropBank.Items.FindByValue(objds.Tables[0].Rows[0]["LBank"].ToString()));
                txtBranchCode.Text            = objds.Tables[0].Rows[0]["LBranchCode"].ToString();
                txtBranchName.Text            = objds.Tables[0].Rows[0]["LBranchName"].ToString();
                txtAccountNo.Text             = objds.Tables[0].Rows[0]["LAccountNo"].ToString();
                dropAccountType.SelectedIndex = dropAccountType.Items.IndexOf(dropAccountType.Items.FindByValue(objds.Tables[0].Rows[0]["LAccountType"].ToString()));
                txtAccHolder.Text             = objds.Tables[0].Rows[0]["LAccHolder"].ToString();

                txtGiAccountSub.Text          = objds.Tables[0].Rows[0]["LQuickGIAccount"].ToString();
                txtLedgerAccount.Text         = objds.Tables[0].Rows[0]["LLedgerAccount"].ToString();
                dropCommiMethod.SelectedIndex = dropCommiMethod.Items.IndexOf(dropCommiMethod.Items.FindByValue(objds.Tables[0].Rows[0]["LCommissMethod"].ToString()));

                if (Convert.ToInt32(objds.Tables[0].Rows[0]["LZeroCommission"].ToString()) == 1)
                {
                    ChkZeroComm.Checked = Convert.ToBoolean(objds.Tables[0].Rows[0]["LZeroCommission"]);
                    txtCommPerc.Enabled = false;
                }
                else
                {
                    txtCommPerc.Text = objds.Tables[0].Rows[0]["LCommPercentage"].ToString().Trim();
                }

                dropPaymentMethod.SelectedIndex = dropPaymentMethod.Items.IndexOf(dropPaymentMethod.Items.FindByValue(objds.Tables[0].Rows[0]["LPaymentMethod"].ToString()));

                if (Convert.ToInt32(objds.Tables[0].Rows[0]["LClientTaxInvoice"].ToString()) == 1)
                {
                    chkClientInvoice.Checked = Convert.ToBoolean(objds.Tables[0].Rows[0]["LClientTaxInvoice"]);
                    dropTreatInvType.Enabled = false;
                }
                else
                {
                    dropTreatInvType.SelectedIndex = dropPaymentMethod.Items.IndexOf(dropPaymentMethod.Items.FindByValue(objds.Tables[0].Rows[0]["LClientInvoiceType"].ToString()));
                }

                chkPrinTaxInvoice.Checked = Convert.ToBoolean(objds.Tables[0].Rows[0]["LPrinciTaxInvoice"]);
                chkAlphaTicket.Checked    = Convert.ToBoolean(objds.Tables[0].Rows[0]["LIgnDupInvoiceNo"]);

                dropAllocItemType.SelectedIndex = dropAllocItemType.Items.IndexOf(dropAllocItemType.Items.FindByValue(objds.Tables[0].Rows[0]["LAllocItemType"].ToString()));

                txtNotes.Text = objds.Tables[0].Rows[0]["LNotes"].ToString();
                dropNoteType.SelectedIndex = dropCommiMethod.Items.IndexOf(dropCommiMethod.Items.FindByValue(objds.Tables[0].Rows[0]["LNoteType"].ToString()));


                txtContactKey.Text       = objds.Tables[0].Rows[0]["LContactKey"].ToString();
                txtContactName.Text      = objds.Tables[0].Rows[0]["LContactName"].ToString();
                txtPosition.Text         = objds.Tables[0].Rows[0]["LContactPosition"].ToString();
                txtTelephone.Text        = objds.Tables[0].Rows[0]["LContTelephone"].ToString();
                txtEmailAddress.Text     = objds.Tables[0].Rows[0]["LContEmailAddress"].ToString();
                chkAutomail.Checked      = Convert.ToBoolean(objds.Tables[0].Rows[0]["LContAutoMail"]);
                txtConFaxNo.Text         = objds.Tables[0].Rows[0]["ContactFax"].ToString();
                txtConCellNo.Text        = objds.Tables[0].Rows[0]["ContactCellNo"].ToString();
                chkConDeactivate.Checked = Convert.ToBoolean(objds.Tables[0].Rows[0]["ContactDeactivate"]);


                if (objds.Tables[1].Rows.Count > 0)
                {
                    BindRepeterContactDetails(objds.Tables[1], rptContactDetails);
                }
            }
        }



        catch (Exception ex)
        {
            lblMsg.Text = _BOUtility.ShowMessage("danger", "Danger", ex.Message);
            ExceptionLogging.SendExcepToDB(ex);
        }
    }