Ejemplo n.º 1
0
        public HttpResponseMessage SaveHod_Allocation(SaveHod_AllocationDTO obj)
        {
            HttpResponseMessage message;

            try
            {
                Hod_AllocationDAL dal = new Hod_AllocationDAL();
                var dynobj            = new { result = dal.SaveHod_Allocation(obj) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynobj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "something Wrong.Try Again!" });
            }
            return(message);
        }
Ejemplo n.º 2
0
        public bool SaveHod_Allocation(SaveHod_AllocationDTO obj)
        {
            bool res = false;

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

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_DepartmentId", obj.DepartmentId);
            cmd.Parameters.AddWithValue("@p_EmployeeId", obj.EmployeeId);
            cmd.Parameters.AddWithValue("@p_ActionBy", obj.CreatedBy);
            int result = new DBlayer().ExecuteNonQuery(cmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }