public static Imgname createAlbum_New(ClsAddUpdateAlbumInput album) { string subgrpIDs = ""; try { if (album.isSubGrpAdmin == "1" && album.type == "0") { subgrpIDs = SubGroupDirectory.GetAdminSubGroupList(album.groupId, album.createdBy); } MySqlParameter[] ParameterList = new MySqlParameter[26]; ParameterList[0] = new MySqlParameter("?p_gallery_id", album.albumId); ParameterList[1] = new MySqlParameter("?p_group_id", album.groupId); ParameterList[2] = new MySqlParameter("?p_gallery_type", album.type); ParameterList[3] = new MySqlParameter("?p_memprofileIDs", album.memberIds); ParameterList[4] = new MySqlParameter("?p_album_title", album.albumTitle); ParameterList[5] = new MySqlParameter("?p_album_description", string.IsNullOrEmpty(album.albumDescription) ? "" : album.albumDescription); ParameterList[6] = new MySqlParameter("?p_image", string.IsNullOrEmpty(album.albumImage) ? "0" : album.albumImage); ParameterList[7] = new MySqlParameter("?p_createdby", album.createdBy); ParameterList[8] = new MySqlParameter("?IsSubgrpAdmin", string.IsNullOrEmpty(album.isSubGrpAdmin) ? "0" : album.isSubGrpAdmin); ParameterList[9] = new MySqlParameter("?subGrpIDs", subgrpIDs); ParameterList[10] = new MySqlParameter("?moduleID", album.moduleId); // Added for Gallery Replica ParameterList[11] = new MySqlParameter("?shareType", album.shareType); // Added for Gallery shareType ParameterList[12] = new MySqlParameter("?categoryId", album.categoryId); ParameterList[13] = new MySqlParameter("?dateofproect", album.dateofproject); ParameterList[14] = new MySqlParameter("?costofproject", album.costofproject); ParameterList[15] = new MySqlParameter("?beneficiary", album.beneficiary); ParameterList[16] = new MySqlParameter("?manhourspent", album.manhourspent); ParameterList[17] = new MySqlParameter("?manhourspenttype", album.manhourspenttype); ParameterList[18] = new MySqlParameter("?p_NumberofRotarian", album.NumberofRotarian); ParameterList[19] = new MySqlParameter("?p_OtherCategorytext", album.OtherCategorytext); ParameterList[20] = new MySqlParameter("?costofprojecttype", album.costofprojecttype); ParameterList[21] = new MySqlParameter("?Attendance", album.Attendance); ParameterList[22] = new MySqlParameter("?AttendancePer", album.AttendancePer); ParameterList[23] = new MySqlParameter("?MeetingType", album.MeetingType); ParameterList[24] = new MySqlParameter("?AgendaDocID", album.AgendaDocID); ParameterList[25] = new MySqlParameter("?MOMDocID", album.MOMDocID); using (TouchBaseWebAPI.Data.row_productionEntities context = new TouchBaseWebAPI.Data.row_productionEntities()) { context.Connection.Open(); var Result = context.ExecuteStoreQuery <Imgname>("CALL V7_1_USPAddEditGallery(?p_gallery_id, ?p_group_id, ?p_gallery_type, ?p_memprofileIDs, ?p_album_title, ?p_album_description, ?p_image, ?p_createdby, ?IsSubgrpAdmin, ?subGrpIDs, ?moduleID, ?shareType,?categoryId,?dateofproect,?costofproject,?beneficiary,?manhourspent,?manhourspenttype,?p_NumberofRotarian,?p_OtherCategorytext,?costofprojecttype,?Attendance,?AttendancePer,?MeetingType,?AgendaDocID,?MOMDocID)", ParameterList).SingleOrDefault(); return(Result); } } catch (Exception ex) { throw ex; } }
public object AddUpdateAlbum(ClsAddUpdateAlbumInput album) { dynamic TBAddGalleryResult; int str = -1; try { Imgname Result = Gallery.createAlbum(album); if (!string.IsNullOrEmpty(Result.imgName)) { str = GlobalFuns.UploadImage(album.groupId, Result.imgName, "gallery"); } else { str = 0; } if (Result != null) { if (str == 0) { TBAddGalleryResult = new { status = "0", message = "success" }; } else { TBAddGalleryResult = new { status = "1", message = "failed" } }; } else { TBAddGalleryResult = new { status = "0", message = "Record not found" }; } } catch { TBAddGalleryResult = new { status = "1", message = "failed" }; } return(new { TBAddGalleryResult }); }
public static Imgname createAlbum(ClsAddUpdateAlbumInput album) { string subgrpIDs = ""; try { if (album.isSubGrpAdmin == "1" && album.type == "0") { subgrpIDs = SubGroupDirectory.GetAdminSubGroupList(album.groupId, album.createdBy); } MySqlParameter[] ParameterList = new MySqlParameter[12]; ParameterList[0] = new MySqlParameter("?p_gallery_id", album.albumId); ParameterList[1] = new MySqlParameter("?p_group_id", album.groupId); ParameterList[2] = new MySqlParameter("?p_gallery_type", album.type); ParameterList[3] = new MySqlParameter("?p_memprofileIDs", album.memberIds); ParameterList[4] = new MySqlParameter("?p_album_title", album.albumTitle); ParameterList[5] = new MySqlParameter("?p_album_description", string.IsNullOrEmpty(album.albumDescription) ? "" : album.albumDescription); ParameterList[6] = new MySqlParameter("?p_image", string.IsNullOrEmpty(album.albumImage) ? "0" : album.albumImage); ParameterList[7] = new MySqlParameter("?p_createdby", album.createdBy); ParameterList[8] = new MySqlParameter("?IsSubgrpAdmin", string.IsNullOrEmpty(album.isSubGrpAdmin) ? "0" : album.isSubGrpAdmin); ParameterList[9] = new MySqlParameter("?subGrpIDs", subgrpIDs); ParameterList[10] = new MySqlParameter("?moduleID", album.moduleId); // Added for Gallery Replica ParameterList[11] = new MySqlParameter("?shareType", album.shareType); // Added for Gallery shareType using (TouchBaseWebAPI.Data.row_productionEntities context = new TouchBaseWebAPI.Data.row_productionEntities()) { context.Connection.Open(); var Result = context.ExecuteStoreQuery <Imgname>("CALL V6_1_USPAddEditGallery(?p_gallery_id, ?p_group_id, ?p_gallery_type, ?p_memprofileIDs, ?p_album_title, ?p_album_description, ?p_image, ?p_createdby, ?IsSubgrpAdmin, ?subGrpIDs, ?moduleID, ?shareType)", ParameterList).SingleOrDefault(); return(Result); } } catch (Exception ex) { throw ex; } }