Ejemplo n.º 1
0
        private void SaveOrEdit()
        {
            string strMessage = string.Empty, NewLibraryId;
            LibrarySettingsClient oLibraryMaster      = new LibrarySettingsClient(ServiceConfig.LibraryDataEndPoint(), ServiceConfig.LibraryDataUri());

            LibrarySettings.LibraryData insertLibrary = new LibrarySettings.LibraryData();
            insertLibrary.Description = txtDescription.Text.Trim();
            insertLibrary.IconName    = IconUpload();
            insertLibrary.InsertBy    = Session["LoggedUser"].ToString();
            insertLibrary.LibraryName = txtLibraryName.Text.Trim();
            insertLibrary.Owner       = Session["LoggedUser"].ToString();
            insertLibrary.ParentId    = ddlParrent.SelectedValue.ToInt();
            insertLibrary.Status      = chkStatus.Checked ? true : false;
            insertLibrary.User        = Session["LoggedUser"].ToString();
            if (ViewState["LibraryId"] != null)
            {
                insertLibrary.LibraryId = ViewState["LibraryId"].ToString().ToInt();
            }
            strMessage             = oLibraryMaster.SaveLibrary(insertLibrary, out NewLibraryId);
            ViewState["LibraryId"] = NewLibraryId;
            Common.SavedMessage(this, strMessage);
            FillLibraryAttributes();
            // Call the user controll Library fill function here to add new Librarys into the tree
            UserControls.LMenu control                = (UserControls.LMenu)FindControl("LMenu");
            control.PopulateMenuDataTable();
            AttributeClear();
            AttributeGroupClear();
        }
Ejemplo n.º 2
0
 protected void grdSearch_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Edit")
     {
         int Index = Convert.ToInt32(e.CommandArgument);
         RetrieveLibraryDetails(Index);
     }
     if (e.CommandName.Equals("Delete"))
     {
         string                      strMsg;
         int                         index          = Convert.ToInt32(e.CommandArgument);
         GridViewRow                 row            = grdSearch.Rows[index];
         Label                       lblLibraryId   = (Label)grdSearch.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("lblLibraryId");
         LibrarySettingsClient       oLibMaster     = new LibrarySettingsClient(ServiceConfig.LibraryDataEndPoint(), ServiceConfig.LibraryDataUri());
         LibrarySettings.LibraryData oDeleteLibrary = new LibrarySettings.LibraryData();
         oDeleteLibrary.LibraryId = lblLibraryId.Text.ToInt();
         strMsg = oLibMaster.DeleteLibraryMaster(oDeleteLibrary);
         SearchClear();
         Common.NotificationMessage(this, strMsg);
     }
 }