Beispiel #1
0
 void CustomizeControl1_RemoveClick(SortedDictionary <string, Control> controls)
 {
     try
     {
         using (Album m = AlbumMethods.GetAlbum(BAYMYO.UI.Converts.NullToInt64(Request.QueryString["vid"])))
         {
             if (m.ID > 0)
             {
                 if (BAYMYO.UI.FileIO.RemoveDirectory(Server.MapPath(Settings.ImagesPath + "album/" + m.ID + "/")))
                 {
                     Core.RemoveForeignKey("galeri", m.ID.ToString());
                     GaleriMethods.Delete(m.ID);
                     if (AlbumMethods.Delete(m) > 0)
                     {
                         Core.CreateContents("galeri");
                         CustomizeControl1.MessageText = MessageBox.Show(ProccesType.Delete, DialogResult.Succes);
                         Core.ClearControls(controls);
                         GetDataPaging(m.ID);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, ex.Message);
     }
 }
Beispiel #2
0
 protected void btnSaveChanges_Click(object sender, EventArgs e)
 {
     try
     {
         if (ddlIslemler.SelectedIndex > 0 & Core.IsUserAdmin)
         {
             bool chkState = false;
             switch (ddlIslemler.SelectedIndex)
             {
             case 1:
                 chkState = true;
                 break;
             }
             if (ddlIslemler.SelectedIndex == 1 || ddlIslemler.SelectedIndex == 2)
             {
                 foreach (GridViewRow item in dataGrid1.Rows)
                 {
                     if (((CheckBox)item.Cells[0].FindControl("chkSelected")).Checked)
                     {
                         Core.Update("album", "aktif", BAYMYO.UI.Converts.NullToGuidString(dataGrid1.DataKeys[item.RowIndex][0]), chkState);
                         break;
                     }
                 }
                 jSonData.CreateData("galeriler");
                 GetDataPaging();
             }
             else if (ddlIslemler.SelectedIndex == 3)
             {
                 foreach (GridViewRow item in dataGrid1.Rows)
                 {
                     if (((CheckBox)item.Cells[0].FindControl("chkSelected")).Checked)
                     {
                         if (BAYMYO.UI.FileIO.RemoveDirectory(Server.MapPath(Settings.ImagesPath + "album/" + dataGrid1.DataKeys[item.RowIndex][0] + "/")))
                         {
                             Core.RemoveForeignKey("galeri", dataGrid1.DataKeys[item.RowIndex][0].ToString());
                             GaleriMethods.Delete(BAYMYO.UI.Converts.NullToInt64(dataGrid1.DataKeys[item.RowIndex][0]));
                             AlbumMethods.Delete(BAYMYO.UI.Converts.NullToInt64(dataGrid1.DataKeys[item.RowIndex][0]));
                         }
                     }
                 }
                 jSonData.CreateData("galeriler");
                 GetDataPaging();
             }
         }
     }
     catch (Exception ex)
     {
         pageNumberLiteral.Text = ex.Message;
     }
 }
Beispiel #3
0
 protected void btnSaveChanges_Click(object sender, EventArgs e)
 {
     try
     {
         Int64 albumID = BAYMYO.UI.Converts.NullToInt64(Request.QueryString["raid"]);
         if (ddlIslemler.SelectedIndex > 0 & albumID > 0)
         {
             if (ddlIslemler.SelectedIndex == 1)
             {
                 foreach (GridViewRow item in dataGrid1.Rows)
                 {
                     if (((CheckBox)item.Cells[0].FindControl("chkSelected")).Checked)
                     {
                         GaleriMethods.Update(albumID);
                         Core.Update("galeri", "kapak", BAYMYO.UI.Converts.NullToGuidString(dataGrid1.DataKeys[item.RowIndex][0]), true);
                         break;
                     }
                 }
             }
             else if (ddlIslemler.SelectedIndex == 2)
             {
                 foreach (GridViewRow item in dataGrid1.Rows)
                 {
                     if (((CheckBox)item.Cells[0].FindControl("chkSelected")).Checked)
                     {
                         if (BAYMYO.UI.FileIO.Remove(Server.MapPath(Settings.ImagesPath + "album/" + albumID + "/" + dataGrid1.DataKeys[item.RowIndex][1].ToString())))
                         {
                             GaleriMethods.Delete(BAYMYO.UI.Converts.NullToGuidString(dataGrid1.DataKeys[item.RowIndex][0]));
                         }
                     }
                 }
             }
             Core.CreateContents("galeri");
             GetDataPaging(albumID);
         }
     }
     catch (Exception ex)
     {
         CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, ex.Message);
     }
 }