Ejemplo n.º 1
0
        public List <FieldOfficerSiteAllDTO> GetAllSite(FieldOfficerSiteDTO objBranch)
        {
            List <FieldOfficerSiteAllDTO> site = new List <FieldOfficerSiteAllDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spAssignFieldOfficer");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@CustomerId", objBranch.CustomerId);
                SqlCmd.Parameters.AddWithValue("@BranchId", objBranch.BranchId);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objBranch.ActionBy);
                site = dbLayer.GetEntityList <FieldOfficerSiteAllDTO>(SqlCmd);
            }
            return(site);
        }
Ejemplo n.º 2
0
        public HttpResponseMessage getAllSite(FieldOfficerSiteDTO site)
        {
            HttpResponseMessage message;

            try
            {
                // AssignFieldOfficerDataAccessLayer _FieldOfficer = new AssignFieldOfficerDataAccessLayer();
                var dynObj = new { result = _FieldOfficer.GetAllSite(site) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" });

                ErrorLog.CreateErrorMessage(ex, "FieldOfficer", "getAllSite");
            }
            return(message);
        }