protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e)
        {
            iCompanySetupClient CompanyClient = new iCompanySetupClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                mChannel      Channel = new mChannel();
                if (hdnState.Value == "Edit")
                {
                    Channel = CompanyClient.GetChannelByChanID(long.Parse(hdnselectedchanID.Value), profile.DBConnection._constr);
                }
                Channel.ChannelName = txtchannelname.Text;
                Channel.ChannelURL  = txtchanlUrl.Text;
                Channel.UserName    = txtusername.Text;
                Channel.Password    = txtpassword.Text;
                Channel.TypeID      = long.Parse(ddlchantype.SelectedItem.Value);
                if (hdnchannelid.Value != "")
                {
                    Channel.StandardChannelID = long.Parse(hdnchannelid.Value);
                }
                if (hndCompanyid.Value != "")
                {
                    Channel.CompanyID = long.Parse(hndCompanyid.Value);
                }
                Channel.CustomerID = long.Parse(hdncustomerid.Value);
                Channel.Active     = "Yes";
                if (rbtnActiveYes.Checked != true)
                {
                    Channel.Active = "No";
                }

                if (hdnState.Value == "Edit")
                {
                    Channel.ModifiedBy   = profile.Personal.UserID;
                    Channel.ModifiedDate = DateTime.Today;
                    long channelid = CompanyClient.SaveChannelDetail(Channel, profile.DBConnection._constr);
                }
                else
                {
                    Channel.CreatedBy    = profile.Personal.UserID;
                    Channel.CreationDate = DateTime.Now;
                    long channelid = CompanyClient.SaveChannelDetail(Channel, profile.DBConnection._constr);
                }
                WebMsgBox.MsgBox.Show("Record saved successfully");
                WarehouseGridBind();
                clear();
                setActiveTab(0);
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Channel Master", "Save");
            }
            finally
            {
                CompanyClient.Close();
            }
        }