Example #1
0
        public JsonResult SaveTraningLocDetails(List <TraningLocDO> SaveDetails)
        {
            int          returnStatus = 0;
            JsonResult   result       = new JsonResult();
            TraningLocBL objBL        = new TraningLocBL();

            TraningLocDO objDO = new TraningLocDO();

            foreach (var item in SaveDetails)
            {
                objDO.LocationName    = item.LocationName;
                objDO.TrainingLocCode = item.TrainingLocCode;
                objDO.ClsRoomCapacity = item.ClsRoomCapacity;
                objDO.NoOfRooms       = item.NoOfRooms;
                objDO.Descriptions    = item.Descriptions;
                objDO.StateId         = item.StateId;
                objDO.City            = item.City;
                objDO.Address         = item.Address;
                objDO.createdby       = item.createdby;
                objDO.Createddate     = item.Createddate;
                objDO.Updatedby       = item.Updatedby;
                objDO.Updatedate      = item.Updatedate;
                objDO.deleteflag      = objDO.deleteflag;

                int obj = 0;
                obj = objBL.SaveTraningDetail(objDO);
                if (obj == 1)
                {
                    returnStatus = 1;
                }
                else
                {
                    returnStatus = -1;
                }
                result.Data = obj;
            }
            return(result);
        }
Example #2
0
        public string UpdateTrainingDetail(List <TraningLocDO> UpdateDetails)
        {
            TraningLocBL objBL      = new TraningLocBL();
            int          result     = 0;
            int          InstanceId = Convert.ToInt32(Session["InstanceId"].ToString());
            int          UserId     = Convert.ToInt32(Session["UserId"].ToString());

            foreach (var item in UpdateDetails)
            {
                item.InstanceId = InstanceId;
                item.createdby  = UserId;


                if (item.LocationId != null)
                {
                    result = objBL.UpdateTrainingDetails(item);
                }
                else
                {
                    result = objBL.SaveTraningDetail(item);
                }
            }
            return(result.ToString());
        }