protected void pageAddNew(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e)
        {
            iProductCategoryMasterClient Message = new iProductCategoryMasterClient();
            CustomProfile profile = CustomProfile.GetProfile();

            tblInterfaceDefLst.Visible             = false;
            tbTemplateDetail.Visible               = true;
            tabContainerReqTemplate.ActiveTabIndex = 1;
            hdnState.Value = "Add";
            if (hdnState.Value == "Add")
            {
                Message.DeleteMessageTemptable(profile.DBConnection._constr);
            }
            clear();
            //GetProductSpecificationDetailByProductID();
            //GetProductTaxDetailByProductID();
            //GetProductImagesByProductID();
            //GVRateHistory();
            //FillInventoryGrid();
            //setActiveTab(1);
            //changePrice1.Attributes.Add("style", "visibility:hidden");
        }
        protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e)
        {
            iProductCategoryMasterClient Message = new iProductCategoryMasterClient();
            CustomProfile profile = CustomProfile.GetProfile();

            if (hdnState.Value == "Add")
            {
                DataSet ds       = new DataSet();
                long    HeaderId = 0;
                try
                {
                    ds = Message.GetMessageTempData(profile.DBConnection._constr);

                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        if (i < 1)
                        {
                            string Destination = ds.Tables[i].Rows[i]["Destination"].ToString();
                            string ActionType  = ds.Tables[i].Rows[i]["ActionType"].ToString();
                            string TableName   = ds.Tables[i].Rows[i]["TableName"].ToString();
                            string description = ds.Tables[i].Rows[i]["description"].ToString();
                            string Remark      = ds.Tables[i].Rows[i]["Remark"].ToString();
                            string sequence    = ds.Tables[i].Rows[i]["sequence"].ToString();
                            string FieldID     = ds.Tables[i].Rows[i]["FieldID"].ToString();
                            long   CreatedBy   = profile.Personal.UserID;
                            Message.InsertMessageHeader(Destination, ActionType, TableName, description, CreatedBy, Remark, profile.DBConnection._constr);
                            DataSet ds1 = new DataSet();
                            ds1      = Message.GetMessHeaderID(profile.DBConnection._constr);
                            HeaderId = Convert.ToInt64(ds1.Tables[0].Rows[0][0].ToString());
                            Message.InsrtIntoMessageHeader(HeaderId, Convert.ToInt64(sequence), Convert.ToInt64(FieldID), CreatedBy, profile.DBConnection._constr);
                        }
                        else
                        {
                            long Sequence  = Convert.ToInt64(ds.Tables[0].Rows[i]["sequence"].ToString());
                            long FieldID   = Convert.ToInt64(ds.Tables[0].Rows[i]["FieldID"].ToString());
                            long CreatedBy = profile.Personal.UserID;
                            Message.InsrtIntoMessageHeader(HeaderId, Sequence, FieldID, CreatedBy, profile.DBConnection._constr);
                        }
                    }
                    Message.DeleteMessageTemptable(profile.DBConnection._constr);
                    WebMsgBox.MsgBox.Show("Record saved successfully");
                }
                catch
                { }
                finally
                { }
            }

            else if (hdnState.Value == "Edit")
            {
                long   MessageID   = Convert.ToInt64(hdnMessageID.Value);
                long   ModifyBy    = profile.Personal.UserID;
                string Destination = ddlDestination.SelectedItem.Text;
                string ActionType  = ddlType.SelectedItem.Text;
                string TableName   = ddlObject.SelectedItem.Text;
                string description = txtTitle.Text;
                string Remark      = txtPurpose.Text;
                try
                {
                    Message.UpdateMessageHeader(MessageID, Destination, ActionType, TableName, description, ModifyBy, Remark, profile.DBConnection._constr);
                    WebMsgBox.MsgBox.Show("Record Update successfully");
                    clear();
                }

                catch { }
                finally { }
            }
        }