示例#1
0
        protected void imgButtonEidt_Click(object sender, EventArgs e)
        {
            ImageButton imgbtn = (ImageButton)sender;
            GridViewRow row    = (GridViewRow)imgbtn.NamingContainer;

            try
            {
                Label           lblBuyerId  = (Label)grdBuyer.Rows[row.RowIndex].FindControl("lblByerId");
                int             ByeryId     = Convert.ToInt16(lblBuyerId.Text);
                Com_Buyer_Setup _buyerSetup = _Buyerbll.GetBuyerById(ByeryId);
                if (_buyerSetup != null)
                {
                    hidBueyId.Value = _buyerSetup.Buyer_ID.ToString();
                    ddlPrincipalName.SelectedValue = _buyerSetup.PrincipalName;
                    ddlCountry.SelectedItem.Text   = _buyerSetup.Country;
                    ddlBuyer.SelectedValue         = _buyerSetup.Buyer_Name;
                    LoadBuyingDepartmentList();
                    ddlBuyingDepartment.SelectedValue = _buyerSetup.BuyingDepartmentId.ToString();
                    txtbxAddress.Text          = _buyerSetup.Address.ToString();
                    txtbxPhone.Text            = _buyerSetup.Phone.ToString();
                    txtEmail.Text              = _buyerSetup.Email.ToString();
                    txtDeliveryAddress.Text    = _buyerSetup.Delivery_Address;
                    txtNotifyParty.Text        = _buyerSetup.NotifyParty;
                    txtDestinationAddress.Text = _buyerSetup.Destination_Address;
                    drpSataus.SelectedValue    = _buyerSetup.Status.ToString();
                    btnSave.Text = "Update";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        protected void imgButtonEidt_Click(object sender, EventArgs e)
        {
            ImageButton imgbtn = (ImageButton)sender;
            GridViewRow row    = (GridViewRow)imgbtn.NamingContainer;

            try
            {
                Label           lblBuyerId  = (Label)grdBuyer.Rows[row.RowIndex].FindControl("lblByerId");
                int             ByeryId     = Convert.ToInt16(lblBuyerId.Text);
                Com_Buyer_Setup _buyerSetup = _Buyerbll.GetBuyerById(ByeryId);
                if (_buyerSetup != null)
                {
                    drpBuyerType.SelectedValue = _buyerSetup.Type.ToString();
                    txtbxAddress.Text          = _buyerSetup.Address.ToString();
                    txtbxBuyerName.Text        = _buyerSetup.Buyer_Name.ToString();
                    txtbxContractPerson.Text   = _buyerSetup.Contact_Person.ToString();
                    txtbxCellNo.Text           = _buyerSetup.Mobile.ToString();
                    txtbxPhone.Text            = _buyerSetup.Phone.ToString();
                    txtEmail.Text              = _buyerSetup.Email.ToString();
                    txtDeliveryAddress.Text    = _buyerSetup.Delivery_Address;
                    txtDestinationAddress.Text = _buyerSetup.Destination_Address;
                    txtSeaAddress.Text         = _buyerSetup.Sea_Address;
                    txtLandAddress.Text        = _buyerSetup.Land_Address;
                    txtBuyerAddress.Text       = _buyerSetup.Buyer_Address;

                    drpSataus.SelectedValue   = _buyerSetup.Status.ToString();
                    drpCountery.SelectedValue = _buyerSetup.Counter.ToString();

                    btnSave.Text    = "Update";
                    hidBueyId.Value = _buyerSetup.Buyer_ID.ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }