コード例 #1
0
        public object AddEbulletin(AddEbulletin addebulltn)
        {
            dynamic TBAddEbulletinResult;
            int     str = 0;

            try
            {
                string Result = Ebulletin.createEbulletin(addebulltn);

                if (!string.IsNullOrEmpty(Result))
                {
                    str = GlobalFuns.uploadDocs(addebulltn.grpID, Result, "ebulletin");
                }

                if (str == 0)
                {
                    TBAddEbulletinResult = new { status = "0", message = "success" };

                    if (addebulltn.ebulletinID != "0")
                    {
                        string url = ConfigurationManager.AppSettings["imgPath"] + "php/EditEbulletin.php?newsID=" + addebulltn.ebulletinID;
                        GroupMaster.Send(url);
                    }
                }
                else
                {
                    TBAddEbulletinResult = new { status = "1", message = "failed" }
                };
            }
            catch
            {
                TBAddEbulletinResult = new { status = "1", message = "failed" };
            }
            return(new { TBAddEbulletinResult });
        }
コード例 #2
0
        public object AddDocument(AddDocument adddoc)
        {
            dynamic TBAddDocumentResult;
            int     str = -1;

            try
            {
                AddDocResult Result = DocumentSafe.createDocument(adddoc);

                if (!string.IsNullOrEmpty(Result.ImgName))
                {
                    str = GlobalFuns.uploadDocs(adddoc.grpID, Result.ImgName, "documentsafe");
                }
                else
                {
                    str = 0;
                }

                if (Result != null)
                {
                    if (str == 0)
                    {
                        TBAddDocumentResult = new { status = "0", message = "success" };

                        //== Commented by Nandu on 01-03-2017 Task-> Cron set on server(notifiy on publish date)

                        //string url = ConfigurationManager.AppSettings["imgPath"] + "php/AddDocument.php?DocID=" + Result.docID;
                        //GroupMaster.Send(url);
                    }
                    else
                    {
                        TBAddDocumentResult = new { status = "1", message = "failed" }
                    };
                }
                else
                {
                    TBAddDocumentResult = new { status = "0", message = "Record not found" };
                }
            }
            catch
            {
                TBAddDocumentResult = new { status = "1", message = "failed" };
            }

            return(new { TBAddDocumentResult });
        }
コード例 #3
0
        public object AddUpdateAlbum_New(ClsAddUpdateAlbumInput album)
        {
            dynamic TBAddGalleryResult;
            int     str       = -1;
            int     Agendastr = -1;
            int     MOMstr    = -1;

            try
            {
                Imgname Result = Gallery.createAlbum_New(album);

                if (!string.IsNullOrEmpty(Result.imgName))
                {
                    str = GlobalFuns.UploadImage(album.groupId, Result.imgName, "gallery");
                }
                else
                {
                    str = 0;
                }

                if (!string.IsNullOrEmpty(Result.AgendaDocID))
                {
                    Agendastr = GlobalFuns.uploadDocs(album.groupId, Result.AgendaDocID, "gallery");
                }
                else
                {
                    Agendastr = 0;
                }

                if (!string.IsNullOrEmpty(Result.MOMDocID))
                {
                    MOMstr = GlobalFuns.uploadDocs(album.groupId, Result.MOMDocID, "gallery");
                }
                else
                {
                    MOMstr = 0;
                }

                if (Result != null)
                {
                    if (str == 0 && Agendastr == 0 && MOMstr == 0)
                    {
                        TBAddGalleryResult = new { status = "0", message = "success", Result.galleryid };
                    }
                    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 });
        }