Exemplo n.º 1
0
        //#region get Manpower bank details
        //public bool GetManpowerBankDetails(ManpowerBankDetailsGetDTO objBankDetails)
        //{
        //    bool res = false;
        //    SqlCommand SqlCmd = new SqlCommand("[dbo].[spGetManpowerBankDetails]");
        //    SqlCmd.CommandType = CommandType.StoredProcedure;
        //    SqlCmd.Parameters.AddWithValue("@ManpowerId", objBankDetails.ManpowerId);
        //    int result = DbLayer.ExecuteNonQuery(SqlCmd);
        //    if (result != Int32.MaxValue)
        //    {
        //        res = true;
        //    }
        //    return res;
        //}

        public List <ManpowerBankDetailsGetDTO> GetManpowerBankDetails(ManpowerBankDetailsGetDTO objBankDetails)
        {
            List <ManpowerBankDetailsGetDTO> bank = new List <ManpowerBankDetailsGetDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spGetManpowerBankDetails");
                SqlCmd.Parameters.AddWithValue("@ManpowerId", objBankDetails.ManpowerId);
                SqlCmd.CommandType = CommandType.StoredProcedure;
                bank = dbLayer.GetEntityList <ManpowerBankDetailsGetDTO>(SqlCmd);
            }
            return(bank);
        }
Exemplo n.º 2
0
        public HttpResponseMessage GetManpowerBankDetails(ManpowerBankDetailsGetDTO objManpowerBankDetails)
        {
            HttpResponseMessage message;

            try
            {
                // ManPowerDataAccessLayer dal = new ManPowerDataAccessLayer();
                var dynObj = new { result = _obj.GetManpowerBankDetails(objManpowerBankDetails) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Somthing wrong, Try Again!" });
                ErrorLog.CreateErrorMessage(ex, "ManPower", "GetManpowerBank");
            }
            return(message);
        }