Пример #1
0
        public bool SaveEventDetails(SaveEventDetailsDTO obj)
        {
            bool res = false;

            obj.CreatedBy = "1001";
            SqlCommand cmd = new SqlCommand("sp_SaveEventDetail");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_StudentId", obj.StudentId);
            cmd.Parameters.AddWithValue("@p_Name", obj.Name);
            cmd.Parameters.AddWithValue("@p_Address", obj.Address);
            cmd.Parameters.AddWithValue("@p_Department", obj.Department);
            cmd.Parameters.AddWithValue("@p_Section", obj.Section);
            cmd.Parameters.AddWithValue("@p_Class", obj.Class);
            cmd.Parameters.AddWithValue("@p_Date", obj.Date);
            cmd.Parameters.AddWithValue("@p_CollegeName", obj.CollegeName);
            cmd.Parameters.AddWithValue("@p_FromTime", obj.FromTime);
            cmd.Parameters.AddWithValue("@p_ToTime", obj.ToTime);
            cmd.Parameters.AddWithValue("@p_EventType", obj.EventType);
            cmd.Parameters.AddWithValue("@p_Status", obj.Status);
            cmd.Parameters.AddWithValue("@p_Purpose", obj.Purpose);
            //cmd.Parameters.AddWithValue("@p_ApprovedStaffBy", obj.ApprovedStaffBy);
            //cmd.Parameters.AddWithValue("@p_ApprovedHodBy", obj.ApprovedHodBy);
            //cmd.Parameters.AddWithValue("@p_StaffApprovalDate", obj.StaffApprovalDate);
            //cmd.Parameters.AddWithValue("@p_HodApprovalDate", obj.HodApprovalDate);
            cmd.Parameters.AddWithValue("@p_ActionBy", obj.CreatedBy);
            int result = new DBlayer().ExecuteNonQuery(cmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }
Пример #2
0
        public HttpResponseMessage SaveEventDetails(SaveEventDetailsDTO obj)
        {
            HttpResponseMessage message;

            try
            {
                EventDetailsDAL dal    = new EventDetailsDAL();
                var             dynobj = new { result = dal.SaveEventDetails(obj) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynobj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "something Wrong.Try Again!" });
            }
            return(message);
        }