예제 #1
0
        public Event GetSingleEventDetails(string Id)
        {
            U_EVNT_MASTERDAL obj  = new U_EVNT_MASTERDAL();
            Event            data = obj.GetSingleEventDetailsDb(Id);

            data.Event_TotalFund         = "0000";
            data.Event_TotalContributors = "0000";
            return(data);
        }
예제 #2
0
        public int GetUpdateEvent(Event eve)
        {
            U_EVNT_MASTERDAL      eveDAL    = new U_EVNT_MASTERDAL();
            U_ADM_MEDIA_MASTERDAL ImgDAL    = new U_ADM_MEDIA_MASTERDAL();
            U_ADM_MEDIA_MASTER    imgData   = new U_ADM_MEDIA_MASTER();
            U_EVNT_MASTER         NewEveObj = new U_EVNT_MASTER();

            var OldEveObj = eveDAL.GetSingleEventDetailsDb(eve.Event_id);

            if (!(eve.Event_PicUrl == "/img/default_event.png") && !(string.IsNullOrEmpty(eve.Event_PicUrl)))
            {
                imgData.Media_Id            = Guid.NewGuid().ToString();
                imgData.Media_Type          = "Image";
                imgData.Media_File_Location = eve.Event_PicUrl;
                imgData.Media_Source        = " ";
                imgData.Media_Oth_Dtl       = " ";
                imgData.Created_by          = eve.Event_Update_by;
                imgData.Updated_by          = eve.Event_Update_by;
                imgData.Created_Date        = DateTime.Now;
                imgData.Updated_Date        = DateTime.Now;
                ImgDAL.InsertU_ADM_MEDIA_MASTER(imgData);
                NewEveObj.Media_Id_Img = imgData.Media_Id;
            }

            NewEveObj.Event_Id        = string.IsNullOrEmpty(eve.Event_id) ? OldEveObj.Event_id : eve.Event_id;
            NewEveObj.Event_Name      = string.IsNullOrEmpty(eve.Event_Name) ? OldEveObj.Event_Name : eve.Event_Name;
            NewEveObj.Even_Location   = string.IsNullOrEmpty(eve.Event_Location) ? OldEveObj.Event_Location : eve.Event_Location;
            NewEveObj.Event_Desc      = string.IsNullOrEmpty(eve.Event_Desc) ? OldEveObj.Event_Desc : eve.Event_Desc;
            NewEveObj.Event_Status    = string.IsNullOrEmpty(eve.Event_Status) ? OldEveObj.Event_Status : eve.Event_Status;
            NewEveObj.Event_StartDate = eve.Event_StartDate;
            NewEveObj.Event_EndDate   = eve.Event_EndDate;
            NewEveObj.Created_Date    = DateTime.Now; //do nothing
            NewEveObj.Updated_Date    = DateTime.Now;
            NewEveObj.Updated_by      = eve.Event_Update_by;
            NewEveObj.Media_Id_Img    = string.IsNullOrEmpty(eve.Event_PicUrl) ? eveDAL.GetEventMediaIdDb(eve.Event_id) : imgData.Media_Id;

            return(eveDAL.Update_EventDetailsDb(NewEveObj));
        }