示例#1
0
        public List <ManpowerAttendanceBranchAllDTO> GetAllBranch(ManpowerAttendanceBranchDTO objBranch)
        {
            List <ManpowerAttendanceBranchAllDTO> branch = new List <ManpowerAttendanceBranchAllDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectAllocateManpower");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@CustomerId", objBranch.CustomerId);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objBranch.ActionBy);
                branch = dbLayer.GetEntityList <ManpowerAttendanceBranchAllDTO>(SqlCmd);
            }
            return(branch);
        }
        public HttpResponseMessage getAllBranch(ManpowerAttendanceBranchDTO branch)
        {
            HttpResponseMessage message;

            try
            {
                // ManpowerAttendanceDAL dal = new ManpowerAttendanceDAL();
                var dynObj = new { result = _obj.GetAllBranch(branch) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" });

                ErrorLog.CreateErrorMessage(ex, "ManpowerAttendance", "getAllBranch");
            }
            return(message);
        }