protected void btncustomernext_Click(object sender, System.EventArgs e)
        {
            CustomProfile       profile    = CustomProfile.GetProfile();
            iCompanySetupClient aggregator = new iCompanySetupClient();

            try
            {
                mAgreegator aggree = new mAgreegator();
                aggree.AgreegatorName    = txtaggregator.Text;
                aggree.ContactPersonName = txtcontactperson.Text;
                aggree.EmailID           = txtemail.Text;
                aggree.MobileNo          = long.Parse(txtmobno.Text);
                aggree.Active            = "Yes";
                if (rbtnActiveNo.Checked == true)
                {
                    aggree.Active = "No";
                }
                aggree.CompanyID    = long.Parse(hdnCompanyid.Value);
                aggree.CustomerID   = long.Parse(hdncustomerid.Value);
                aggree.CreatedBy    = profile.Personal.UserID;
                aggree.CreationDate = DateTime.Now;
                long AggreeID = aggregator.SaveAggregatorMaster(aggree, profile.DBConnection._constr);
                hdnselectedAggID.Value = AggreeID.ToString();
                setActiveTab(2);
                btncustomernext.Visible = false;
            }
            catch (Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Aggregator Master", "Buttonnextsave");
            }
            finally
            {
                aggregator.Close();
            }
        }
        protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e)
        {
            CustomProfile       profile    = CustomProfile.GetProfile();
            iCompanySetupClient aggregator = new iCompanySetupClient();
            mAgreegator         aggree     = new mAgreegator();

            if (hdnState.Value == "Edit")
            {
                aggree = aggregator.GetAggregatorMasterbyID(long.Parse(hdnselectedAggID.Value), profile.DBConnection._constr);
            }
            aggree.AgreegatorName    = txtaggregator.Text;
            aggree.ContactPersonName = txtcontactperson.Text;
            aggree.EmailID           = txtemail.Text;
            aggree.MobileNo          = long.Parse(txtmobno.Text);
            aggree.Active            = "Yes";
            if (rbtnActiveNo.Checked == true)
            {
                aggree.Active = "No";
            }
            aggree.CompanyID  = long.Parse(hdnCompanyid.Value);
            aggree.CustomerID = long.Parse(hdncustomerid.Value);
            if (hdnState.Value == "Edit")
            {
                aggree.ModifiedBy   = profile.Personal.UserID;
                aggree.ModifiedDate = DateTime.Now;
                long AggreeID = aggregator.SaveAggregatorMaster(aggree, profile.DBConnection._constr);
            }
            BindAgregatorGridMain();
            setActiveTab(0);
        }
        public void GetAggregatmasterDetail(long AggregatID)
        {
            iCompanySetupClient aggregator = new iCompanySetupClient();
            CustomProfile       profile    = CustomProfile.GetProfile();
            mAgreegator         aggree     = new mAgreegator();

            aggree = aggregator.GetAggregatorMasterbyID(AggregatID, profile.DBConnection._constr);
            FillCompany();
            if (aggree.CompanyID != null)
            {
                ddlcompany.SelectedIndex = ddlcompany.Items.IndexOf(ddlcompany.Items.FindByValue(aggree.CompanyID.ToString()));
            }
            hdnCompanyid.Value = aggree.CompanyID.ToString();
            getCustomer(long.Parse(aggree.CompanyID.ToString()));
            if (aggree.CustomerID != null)
            {
                ddlcutomer.SelectedIndex = ddlcutomer.Items.IndexOf(ddlcutomer.Items.FindByValue(aggree.CustomerID.ToString()));
            }
            hdncustomerid.Value = aggree.CustomerID.ToString();
            if (aggree.AgreegatorName != null)
            {
                txtaggregator.Text = aggree.AgreegatorName.ToString();
            }
            if (aggree.ContactPersonName != null)
            {
                txtcontactperson.Text = aggree.ContactPersonName.ToString();
            }
            if (aggree.EmailID != null)
            {
                txtemail.Text = aggree.EmailID.ToString();
            }
            if (aggree.MobileNo != null)
            {
                txtmobno.Text = aggree.MobileNo.ToString();
            }
            if (aggree.Active == "No")
            {
                rbtnActiveNo.Checked = true;
            }
        }