public List <GetBranchByCustomerDTO> GetAllBranch(GetCustomersBranchDTO objBranch)
        {
            List <GetBranchByCustomerDTO> role = new List <GetBranchByCustomerDTO>();

            SqlCommand SqlCmd = new SqlCommand("spSelectBranch");

            SqlCmd.Parameters.AddWithValue("@CustomerId", objBranch.CustomerId);
            SqlCmd.Parameters.AddWithValue("@ActionBy", objBranch.ActionBy);
            SqlCmd.CommandType = CommandType.StoredProcedure;
            role = _unitOfWork.DbLayer.GetEntityList <GetBranchByCustomerDTO>(SqlCmd);

            return(role);
        }
예제 #2
0
        public HttpResponseMessage getBranch(GetCustomersBranchDTO branch)
        {
            HttpResponseMessage message;

            try
            {
                //  CustomerSiteMappingDataAccessLayer dal = new CustomerSiteMappingDataAccessLayer();
                var dynObj = new { result = _Customermapping.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, "CustomerSiteMapping", "getBranch");
            }
            return(message);
        }