示例#1
0
 protected void grdAttribute_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Edit")
     {
         int         Index          = Convert.ToInt32(e.CommandArgument);
         Label       lblAttributeId = (Label)grdAttribute.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("lblAttributeId");
         HiddenField hfLibraryId    = (HiddenField)grdAttribute.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("hfLibraryId");
         ViewState["AttributeId"] = lblAttributeId.Text.Trim();
         ViewState["LibraryId"]   = hfLibraryId.Value;
         FillDetails();
     }
     if (e.CommandName == "Delete")
     {
         string      strMsg;
         int         index = Convert.ToInt32(e.CommandArgument);
         GridViewRow row   = grdAttribute.Rows[index];
         int         AttributeId;
         Label       lblAttributeIditem = (Label)grdAttribute.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("lblAttributeId");
         AttributeId = Convert.ToInt16(lblAttributeIditem.Text);
         AttributeService.AttributeSettingsClient oClient = new AttributeService.AttributeSettingsClient(ServiceConfig.AttributeSettingsDataEndPoint(), ServiceConfig.AttributeSettingsDataUri());
         AttributeService.AttributeSettingsData   oData   = new AttributeService.AttributeSettingsData();
         oData.AttributeId = AttributeId;
         strMsg            = oClient.DeleteAttributeMaster(oData);
         SearchClear();
         Common.NotificationMessage(this, strMsg);
     }
 }
示例#2
0
        protected void grdLibAttributesGroups_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string      strMsg;
            int         index      = Convert.ToInt32(e.RowIndex);
            GridViewRow row        = grdSearch.Rows[index];
            Label       lblGroupId = (Label)grdLibAttributesGroups.Rows[Convert.ToInt32(e.RowIndex)].FindControl("lblGroupId");

            AttributeService.AttributeSettingsClient oClient = new AttributeService.AttributeSettingsClient(ServiceConfig.AttributeSettingsDataEndPoint(), ServiceConfig.AttributeSettingsDataUri());
            AttributeService.AttributeSettingsData   oData   = new AttributeService.AttributeSettingsData();
            oData.GroupId = lblGroupId.Text.Trim().ToInt();
            strMsg        = oClient.DeleteAttributeGroupMaster(oData);
            Common.ErrorMessage(this, strMsg);
            FillLibraryAttributesGroups();
        }