Exemplo n.º 1
0
        public void TestMethod1()
        {
            //用户统计
            //新增
            UsersStatSearchDTO searchdto = new UsersStatSearchDTO();

            searchdto.page = 1;
            searchdto.rows = 1;
            var searchdtostr = TransformHelper.ConvertDTOTOBase64JsonString(searchdto);

            testcontroller.GetUsersStatList(searchdtostr);
            UsersStatOperateDTO adddto = new UsersStatOperateDTO();

            adddto.UseModel     = "单元测试用户统计";
            adddto.UseModelTime = DateTime.Now;
            searchdto.rows      = 20;
            searchdtostr        = TransformHelper.ConvertDTOTOBase64JsonString(searchdto);
            var addresult   = testcontroller.AddUsersStat(adddto);
            var resultlist1 = JsonConvert.DeserializeObject <ResultDTO <List <UsersStatResultDTO> > >(testcontroller.GetUsersStatList(searchdtostr).Content.ReadAsStringAsync().Result).Object;
            var target      = resultlist1.Where(m => m.UseModel == "单元测试用户统计").FirstOrDefault();

            Assert.IsNotNull(target);

            //删除
            UsersStatResultDTO deletedto = new UsersStatResultDTO();

            deletedto.UsersStatID = target.UsersStatID;
            var deletedtostr = TransformHelper.ConvertDTOTOBase64JsonString(deletedto);
            var deleteresult = testcontroller.DeleteUsersStat(deletedtostr);
            var resultlist3  = JsonConvert.DeserializeObject <ResultDTO <List <UsersStatResultDTO> > >(testcontroller.GetUsersStatList(searchdtostr).Content.ReadAsStringAsync().Result).Object;

            target = resultlist3.Where(m => m.UsersStatID == target.UsersStatID).FirstOrDefault();
            Assert.IsNull(target);
        }
Exemplo n.º 2
0
        public void TestMethod1()
        {
            //仪器类型
            //新增
            testcontroller.GetInstrumentTypeList();
            InstrumentTypeOperateDTO adddto = new InstrumentTypeOperateDTO();

            adddto.InstrumentTypeName = "单元测试钢材";
            adddto.CreateTime         = DateTime.Now;
            var addresult   = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.AddInstrumentType(adddto).Content.ReadAsStringAsync().Result);
            var resultlist1 = JsonConvert.DeserializeObject <List <InstrumentTypeResultDTO> >(testcontroller.GetInstrumentTypeList().Content.ReadAsStringAsync().Result);
            var target      = resultlist1.Where(m => m.InstrumentTypeName == "单元测试钢材").FirstOrDefault();

            Assert.IsNotNull(target);

            //修改
            adddto.InstrumentTypeID   = target.InstrumentTypeID;
            adddto.InstrumentTypeName = "修改单元测试仪器类型名称";
            var updateresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.UpdateInstrumentType(adddto).Content.ReadAsStringAsync().Result);
            var resultlist2  = JsonConvert.DeserializeObject <List <InstrumentTypeResultDTO> >(testcontroller.GetInstrumentTypeList().Content.ReadAsStringAsync().Result);

            target = resultlist2.Where(m => m.InstrumentTypeName == "修改单元测试仪器类型名称").FirstOrDefault();
            Assert.IsNotNull(target);

            //删除
            InstrumentTypeSearchDTO deletedto = new InstrumentTypeSearchDTO();

            deletedto.InstrumentTypeID = target.InstrumentTypeID;
            var deletedtostr = TransformHelper.ConvertDTOTOBase64JsonString(deletedto);
            var deleteresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.DeleteProductType(deletedtostr).Content.ReadAsStringAsync().Result);
            var resultlist3  = JsonConvert.DeserializeObject <List <InstrumentTypeResultDTO> >(testcontroller.GetInstrumentTypeList().Content.ReadAsStringAsync().Result);

            target = resultlist3.Where(m => m.InstrumentTypeID == target.InstrumentTypeID).FirstOrDefault();
            Assert.IsNull(target);
        }
Exemplo n.º 3
0
        public void TestMethod1()
        {
            //关账日
            //新增
            testcontroller.GetAccountDateList();
            AccountDateOperateDTO adddto = new AccountDateOperateDTO();

            adddto.AccountDateBelongModel = "基础数据";
            adddto.AccountDateName        = "单元测试关账日名称";
            var addresult   = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.AddAccountDate(adddto).Content.ReadAsStringAsync().Result);
            var resultlist1 = JsonConvert.DeserializeObject <List <AccountDateResultDTO> >(testcontroller.GetAccountDateList().Content.ReadAsStringAsync().Result);
            var target      = resultlist1.Where(m => m.AccountDateName == "单元测试关账日名称").FirstOrDefault();

            Assert.IsNotNull(target);

            //修改
            adddto.AccountDateID   = target.AccountDateID;
            adddto.AccountDateName = "修改单元测试关账日名称";
            var updateresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.UpdateAccountDate(adddto).Content.ReadAsStringAsync().Result);
            var resultlist2  = JsonConvert.DeserializeObject <List <AccountDateResultDTO> >(testcontroller.GetAccountDateList().Content.ReadAsStringAsync().Result);

            target = resultlist2.Where(m => m.AccountDateName == "修改单元测试关账日名称").FirstOrDefault();
            Assert.IsNotNull(target);

            //删除
            AccountDateSearchDTO deletedto = new AccountDateSearchDTO();

            deletedto.AccountDateID = target.AccountDateID;
            var deletedtostr = TransformHelper.ConvertDTOTOBase64JsonString(deletedto);
            var deleteresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.DeleteAccountDate(deletedtostr).Content.ReadAsStringAsync().Result);
            var resultlist3  = JsonConvert.DeserializeObject <List <AccountDateResultDTO> >(testcontroller.GetAccountDateList().Content.ReadAsStringAsync().Result);

            target = resultlist3.Where(m => m.AccountDateID == target.AccountDateID).FirstOrDefault();
            Assert.IsNull(target);
        }
Exemplo n.º 4
0
        public void TestMethod1()
        {
            //部门
            //新增
            testcontroller.GetDepartmentList();
            DepartmentOperateDTO adddto = new DepartmentOperateDTO();

            adddto.DepartName = "单元测试部门";
            var addresult   = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.AddDepartment(adddto).Content.ReadAsStringAsync().Result);
            var resultlist1 = JsonConvert.DeserializeObject <List <DepartmentResultDTO> >(testcontroller.GetDepartmentList().Content.ReadAsStringAsync().Result);
            var target      = resultlist1.Where(m => m.DepartName == "单元测试部门").FirstOrDefault();

            Assert.IsNotNull(target);

            //修改
            adddto.DepartID   = target.DepartID;
            adddto.DepartName = "修改单元测试部门";
            var updateresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.UpdateDepartment(adddto).Content.ReadAsStringAsync().Result);
            var resultlist2  = JsonConvert.DeserializeObject <List <DepartmentResultDTO> >(testcontroller.GetDepartmentList().Content.ReadAsStringAsync().Result);

            target = resultlist2.Where(m => m.DepartName == "修改单元测试部门").FirstOrDefault();
            Assert.IsNotNull(target);

            //删除
            DepartmentSearchDTO deletedto = new DepartmentSearchDTO();

            deletedto.DepartID = target.DepartID;
            var deletedtostr    = TransformHelper.ConvertDTOTOBase64JsonString(deletedto);
            var deleteresultstr = testcontroller.DeleteDepartment(deletedtostr).Content.ReadAsStringAsync().Result;
            var deleteresult    = JsonConvert.DeserializeObject <ResultDTO <object> >(deleteresultstr);
            var resultlist3     = JsonConvert.DeserializeObject <List <DepartmentResultDTO> >(testcontroller.GetDepartmentList().Content.ReadAsStringAsync().Result);

            target = resultlist3.Where(m => m.DepartID == target.DepartID).FirstOrDefault();
            Assert.IsNull(target);
        }
Exemplo n.º 5
0
        public void TestMethod1()
        {
            //产品类型
            //新增
            ProductInfoSearchDTO searchdto = new ProductInfoSearchDTO();

            searchdto.page = 1;
            searchdto.rows = 1;
            var searchdtostr = TransformHelper.ConvertDTOTOBase64JsonString(searchdto);

            testcontroller.GetReagentInfoList(searchdtostr);
            ProductInfoOperateDTO adddto = new ProductInfoOperateDTO();

            adddto.ProductID     = Guid.NewGuid();
            adddto.ArtNo         = "单元测试试剂产品货号";
            adddto.CreateTime    = DateTime.Now;
            adddto.IsMaintenance = false;
            adddto.ProductName   = "单元测试试剂产品名称";
            var addresultstr = testcontroller.AddReagentInfo(adddto).Content.ReadAsStringAsync().Result;
            var addresult    = JsonConvert.DeserializeObject <ResultDTO <object> >(addresultstr);

            searchdto.rows       = 10;
            searchdto.SearchText = "单元测试试剂产品名称";
            searchdtostr         = TransformHelper.ConvertDTOTOBase64JsonString(searchdto);
            var resultlist1str = testcontroller.GetReagentInfoList(searchdtostr).Content.ReadAsStringAsync().Result;
            var resultlist1    = JsonConvert.DeserializeObject <ResultDTO <List <ProductInfoResultDTO> > >(resultlist1str).Object;
            var target         = resultlist1.Where(m => m.ProductName == "单元测试试剂产品名称").FirstOrDefault();

            Assert.IsNotNull(target);

            //修改
            adddto.ProductID     = target.ProductID;
            adddto.ProductName   = "修改单元测试试剂产品名称";
            adddto.IsMaintenance = false;
            adddto.UpType        = 1;
            var updateresultstr = testcontroller.UpdateReagentInfo(adddto).Content.ReadAsStringAsync().Result;
            var updateresult    = JsonConvert.DeserializeObject <ResultDTO <object> >(updateresultstr);

            searchdto.SearchText = "修改单元测试试剂产品名称";
            searchdtostr         = TransformHelper.ConvertDTOTOBase64JsonString(searchdto);
            var resultlist2str = testcontroller.GetReagentInfoList(searchdtostr).Content.ReadAsStringAsync().Result;
            var resultlist2    = JsonConvert.DeserializeObject <ResultDTO <List <ProductInfoResultDTO> > >(resultlist2str).Object;

            target = resultlist2.Where(m => m.ProductName == "修改单元测试试剂产品名称").FirstOrDefault();
            Assert.IsNotNull(target);

            //删除
            ProductInfoOperateDTO deletedto = new ProductInfoOperateDTO();

            deletedto.ProductID = target.ProductID;
            var deletedtostr    = TransformHelper.ConvertDTOTOBase64JsonString(deletedto);
            var deleteresultstr = testcontroller.DeleteReagentInfo(deletedtostr).Content.ReadAsStringAsync().Result;
            var deleteresult    = JsonConvert.DeserializeObject <ResultDTO <object> >(deleteresultstr);
            var resultlist3str  = testcontroller.GetReagentInfoList(searchdtostr).Content.ReadAsStringAsync().Result;
            var resultlist3     = JsonConvert.DeserializeObject <ResultDTO <List <ProductInfoResultDTO> > >(resultlist3str).Object;

            target = resultlist3.Where(m => m.ProductID == target.ProductID).FirstOrDefault();
            Assert.IsNull(target);
        }
Exemplo n.º 6
0
        public void TestMethod1()
        {
            //客户信息.戴锐
            //新增

            CustomerSearchDTO adddto = new CustomerSearchDTO();

            adddto.page = 1;
            adddto.rows = 1;

            var dtostr = TransformHelper.ConvertDTOTOBase64JsonString(adddto);

            testcontroller.GetCustomerList(dtostr);
            CustomerOperateDTO adddtotest = new CustomerOperateDTO();

            adddtotest.CustomerName = "单元测试客户名称001";
            adddtotest.CustomerID   = Guid.NewGuid();
            var addresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.AddCustomer(adddtotest).Content.ReadAsStringAsync().Result);

            adddto.rows       = 10;
            adddto.SearchText = "单元测试客户名称001";
            dtostr            = TransformHelper.ConvertDTOTOBase64JsonString(adddto);
            var resultlist1 = JsonConvert.DeserializeObject <ResultDTO <List <CustomerResultDTO> > >(testcontroller.GetCustomerList(dtostr).Content.ReadAsStringAsync().Result).Object;
            var target      = resultlist1.Where(m => m.CustomerName == "单元测试客户名称001").FirstOrDefault();

            Assert.IsNotNull(target);

            //修改
            adddtotest.CustomerID   = target.CustomerID;
            adddtotest.CustomerName = "修改单元测试客户名称的002";
            adddtotest.UpType       = 1;
            var updateresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.UpdateCustomer(adddtotest).Content.ReadAsStringAsync().Result);

            adddto.SearchText = "修改单元测试客户名称的002";
            dtostr            = TransformHelper.ConvertDTOTOBase64JsonString(adddto);
            var resultlist2 = JsonConvert.DeserializeObject <ResultDTO <List <CustomerResultDTO> > >(testcontroller.GetCustomerList(dtostr).Content.ReadAsStringAsync().Result).Object;

            target = resultlist2.Where(m => m.CustomerName == "修改单元测试客户名称的002").FirstOrDefault();
            Assert.IsNotNull(target);

            //删除
            CustomerSearchDTO deletedto = new CustomerSearchDTO();

            deletedto.CustomerID = target.CustomerID;
            var deletedtostr = TransformHelper.ConvertDTOTOBase64JsonString(deletedto);
            var deleteresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.DeleteCustomer(deletedtostr).Content.ReadAsStringAsync().Result);
            var resultlist3  = JsonConvert.DeserializeObject <ResultDTO <List <CustomerResultDTO> > >(testcontroller.GetCustomerList(dtostr).Content.ReadAsStringAsync().Result).Object;

            target = resultlist3.Where(m => m.CustomerID == target.CustomerID).FirstOrDefault();
            Assert.IsNull(target);

            //停用
        }
Exemplo n.º 7
0
        public void TestMethod1()
        {
            var testdto = new TestDTO();

            testdto.Name = "测试姓名";
            testdto.Age  = 25;
            testdto.Sex  = true;
            testdto.ID   = Guid.Parse("A4F3F091-541C-470F-BBF9-222684B2719F");
            var Transformstr = TransformHelper.ConvertDTOTOBase64JsonString(testdto);

            var TransformedDTO = TransformHelper.ConvertBase64JsonStringToDTO <TestDTO>(Transformstr);

            Assert.AreEqual(testdto.Name, TransformedDTO.Name);
            Assert.AreEqual(testdto.Age, TransformedDTO.Age);
            Assert.AreEqual(testdto.Sex, TransformedDTO.Sex);
            Assert.AreEqual(testdto.ID, TransformedDTO.ID);
        }
Exemplo n.º 8
0
        public void TestMethod1()
        {
            //产品类型
            //新增
            ProductTypeSearchDTO searchdto = new ProductTypeSearchDTO();
            var searchdtostr = TransformHelper.ConvertDTOTOBase64JsonString(searchdto);

            testcontroller.GetProductTypeList(searchdtostr);
            ProductTypeOperateDTO adddto = new ProductTypeOperateDTO();

            adddto.ProductTypeName = "单元测试产品类型名称";
            var addresultstr = testcontroller.AddProductType(adddto).Content.ReadAsStringAsync().Result;
            var addresult    = JsonConvert.DeserializeObject <ResultDTO <object> >(addresultstr);
            var resultlist1  = JsonConvert.DeserializeObject <List <ProductTypeResultDTO> >(testcontroller.GetProductTypeList(searchdtostr).Content.ReadAsStringAsync().Result);
            var target       = resultlist1.Where(m => m.ProductTypeName == "单元测试产品类型名称").FirstOrDefault();

            Assert.IsNotNull(target);

            //修改
            adddto.ProductTypeID   = target.ProductTypeID;
            adddto.ProductTypeName = "修改单元测试产品类型名称";
            var updateresultstr = testcontroller.UpdateProductType(adddto).Content.ReadAsStringAsync().Result;
            var updateresult    = JsonConvert.DeserializeObject <ResultDTO <object> >(updateresultstr);

            var resultlist2str = testcontroller.GetProductTypeList(searchdtostr).Content.ReadAsStringAsync().Result;
            var resultlist2    = JsonConvert.DeserializeObject <List <ProductTypeResultDTO> >(resultlist2str);

            target = resultlist2.Where(m => m.ProductTypeName == "修改单元测试产品类型名称").FirstOrDefault();
            Assert.IsNotNull(target);

            //删除
            ProductTypeSearchDTO deletedto = new ProductTypeSearchDTO();

            deletedto.ProductTypeID = target.ProductTypeID;
            var deletedtostr    = TransformHelper.ConvertDTOTOBase64JsonString(deletedto);
            var deleteresultstr = testcontroller.DeleteProductType(deletedtostr).Content.ReadAsStringAsync().Result;
            var deleteresult    = JsonConvert.DeserializeObject <ResultDTO <object> >(deleteresultstr);
            var resultlist3str  = testcontroller.GetProductTypeList(searchdtostr).Content.ReadAsStringAsync().Result;
            var resultlist3     = JsonConvert.DeserializeObject <List <ProductTypeResultDTO> >(resultlist3str);

            target = resultlist3.Where(m => m.ProductTypeID == target.ProductTypeID).FirstOrDefault();
            Assert.IsNull(target);
        }
Exemplo n.º 9
0
        public void TestMethod1()
        {
            //付款条款
            //新增
            PaymentSearchDTO searchdto = new PaymentSearchDTO();
            var searchdtostr           = TransformHelper.ConvertDTOTOBase64JsonString(searchdto);

            testcontroller.GetPaymentList(searchdtostr);
            PaymentOperateDTO adddto = new PaymentOperateDTO();

            adddto.PayName = "单元测试付款条款名称";
            var addresult   = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.AddPayment(adddto).Content.ReadAsStringAsync().Result);
            var resultlist1 = JsonConvert.DeserializeObject <List <PaymentResultDTO> >(testcontroller.GetPaymentList(searchdtostr).Content.ReadAsStringAsync().Result);
            var target      = resultlist1.Where(m => m.PayName == "单元测试付款条款名称").FirstOrDefault();

            Assert.IsNotNull(target);

            //修改
            adddto.PayID   = target.PayID;
            adddto.PayName = "修改单元测试付款条款名称";
            adddto.UpType  = 1;
            var updateresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.UpdatePayment(adddto).Content.ReadAsStringAsync().Result);
            var resultlist2  = JsonConvert.DeserializeObject <List <PaymentResultDTO> >(testcontroller.GetPaymentList(searchdtostr).Content.ReadAsStringAsync().Result);

            target = resultlist2.Where(m => m.PayName == "修改单元测试付款条款名称").FirstOrDefault();
            Assert.IsNotNull(target);

            //删除
            PaymentSearchDTO deletedto = new PaymentSearchDTO();

            deletedto.PayID = target.PayID;
            var deletedtostr = TransformHelper.ConvertDTOTOBase64JsonString(deletedto);
            var deleteresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.DeletePayment(deletedtostr).Content.ReadAsStringAsync().Result);
            var resultlist3  = JsonConvert.DeserializeObject <List <PaymentResultDTO> >(testcontroller.GetPaymentList(searchdtostr).Content.ReadAsStringAsync().Result);

            target = resultlist3.Where(m => m.PayID == target.PayID).FirstOrDefault();
            Assert.IsNull(target);
        }
Exemplo n.º 10
0
        public void TestMethod1()
        {
            //短信统计
            //新增
            MessageSearchDTO searchdto = new MessageSearchDTO();

            searchdto.page = 1;
            searchdto.rows = 1;
            var searchdtostr = TransformHelper.ConvertDTOTOBase64JsonString(searchdto);

            testcontroller.GetMessageStatList(searchdtostr);
            List <MessageOperateDTO> dtolist = new List <MessageOperateDTO>();

            dtolist.Add(new MessageOperateDTO
            {
                MessageType = -1,
                SendTime    = DateTime.Now,
                UserID      = 1
            });
            var addresult = testcontroller.AddMessageStat(dtolist);

            searchdto.rows = 20;
            var resultlist1 = JsonConvert.DeserializeObject <ResultDTO <List <MessageResultDTO> > >(testcontroller.GetMessageStatList(searchdtostr).Content.ReadAsStringAsync().Result).Object;
            var target      = resultlist1.Where(m => m.MessageType == -1).FirstOrDefault();

            Assert.IsNotNull(target);

            //删除
            MessageResultDTO deletedto = new MessageResultDTO();

            deletedto.MessageStatID = target.MessageStatID;
            var deletedtostr = TransformHelper.ConvertDTOTOBase64JsonString(deletedto);
            var deleteresult = testcontroller.DeleteMessageStat(deletedtostr);
            var resultlist3  = JsonConvert.DeserializeObject <ResultDTO <List <MessageResultDTO> > >(testcontroller.GetMessageStatList(searchdtostr).Content.ReadAsStringAsync().Result).Object;

            target = resultlist3.Where(m => m.MessageStatID == target.MessageStatID).FirstOrDefault();
            Assert.IsNull(target);
        }
Exemplo n.º 11
0
        public void TestMethod1()
        {
            //角色管理
            //新增
            RoleSearchDTO adddto       = new RoleSearchDTO();
            var           searchdtostr = TransformHelper.ConvertDTOTOBase64JsonString(adddto);

            testcontroller.GetRoleList(searchdtostr);
            RoleOperateDTO adddtotest = new RoleOperateDTO();

            adddtotest.RoleName = "单元测试角色";
            var addresult   = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.AddRole(adddtotest).Content.ReadAsStringAsync().Result);
            var resultlist1 = JsonConvert.DeserializeObject <List <RoleResultDTO> >(testcontroller.GetRoleList(searchdtostr).Content.ReadAsStringAsync().Result);
            var target      = resultlist1.Where(m => m.RoleName == "单元测试角色").FirstOrDefault();

            Assert.IsNotNull(target);

            //修改
            adddtotest.RoleID   = target.RoleID;
            adddtotest.RoleName = "修改成功的单元测试角色";
            var updateresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.UpdateRole(adddtotest).Content.ReadAsStringAsync().Result);
            var resultlist2  = JsonConvert.DeserializeObject <List <RoleResultDTO> >(testcontroller.GetRoleList(searchdtostr).Content.ReadAsStringAsync().Result);

            target = resultlist2.Where(m => m.RoleName == "修改成功的单元测试角色").FirstOrDefault();
            Assert.IsNotNull(target);

            //删除
            RoleSearchDTO deleteDto = new RoleSearchDTO();

            deleteDto.RoleID = target.RoleID;
            var deleteDtoster = TransformHelper.ConvertDTOTOBase64JsonString(deleteDto);
            var deleteresult  = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.DeleteRole(deleteDtoster).Content.ReadAsStringAsync().Result);
            var resultlist3   = JsonConvert.DeserializeObject <List <RoleResultDTO> >(testcontroller.GetRoleList(searchdtostr).Content.ReadAsStringAsync().Result);

            target = resultlist3.Where(m => m.RoleID == target.RoleID).FirstOrDefault();
            Assert.IsNull(target);
        }
Exemplo n.º 12
0
        public void TestMethod1()
        {
            //大小区
            //新增
            AreaSearchDTO searchdto    = new AreaSearchDTO();
            var           searchdtostr = TransformHelper.ConvertDTOTOBase64JsonString(searchdto);

            testcontroller.GetAreaTree(searchdtostr);
            AreaOperateDTO adddto = new AreaOperateDTO();

            adddto.AreaName = "单元测试大小区";
            var addresult   = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.AddArea(adddto).Content.ReadAsStringAsync().Result);
            var resultlist1 = JsonConvert.DeserializeObject <List <AreaResultDTO> >(testcontroller.GetAreaTree(searchdtostr).Content.ReadAsStringAsync().Result);
            var target      = resultlist1.Where(m => m.AreaName == "单元测试大小区").FirstOrDefault();

            Assert.IsNotNull(target);

            //修改
            adddto.AreaID   = target.AreaID;
            adddto.AreaName = "修改单元测试大小区";
            var updateresult = JsonConvert.DeserializeObject <ResultDTO <object> >(testcontroller.UpdateArea(adddto).Content.ReadAsStringAsync().Result);
            var resultlist2  = JsonConvert.DeserializeObject <List <AreaResultDTO> >(testcontroller.GetAreaTree(searchdtostr).Content.ReadAsStringAsync().Result);

            target = resultlist2.Where(m => m.AreaName == "修改单元测试大小区").FirstOrDefault();
            Assert.IsNotNull(target);

            //删除
            AreaOperateDTO deletedto = new AreaOperateDTO();

            deletedto.AreaID = target.AreaID;
            var deletedtostr = TransformHelper.ConvertDTOTOBase64JsonString(deletedto);
            var deleteresult = JsonConvert.DeserializeObject <bool>(testcontroller.DeleteArea(deletedtostr).Content.ReadAsStringAsync().Result);
            var resultlist3  = JsonConvert.DeserializeObject <List <AreaResultDTO> >(testcontroller.GetAreaTree(searchdtostr).Content.ReadAsStringAsync().Result);

            target = resultlist3.Where(m => m.AreaID == target.AreaID).FirstOrDefault();
            Assert.IsNull(target);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 维修产品删除
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <object> DeleteMaintenancePrice(ProductPriceInfoOperateDTO dto)
        {
            ResultData <object> blResult = DeleteAPI <ResultData <object> >(WebConfiger.MasterDataServicesUrl + "MaintenancePrice?ProductPriceInfoOperateDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(blResult);
        }
Exemplo n.º 14
0
 /// <summary>
 /// 导入经销商公告授权
 /// </summary>
 /// <param name="regentprdlist"></param>
 /// <returns></returns>
 public static ResultData <object> ImportDistributorAnnounceAuthority(List <ExcelDistributorADAuthorityDTO> implist)
 {
     return(PostAPI <ResultData <object> >(WebConfiger.MasterDataServicesUrl + "ImportData", new { Data = TransformHelper.ConvertDTOTOBase64JsonString(implist), Type = 8 }));
 }
Exemplo n.º 15
0
        /// <summary>
        /// 得到一条经销商信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <DistributorModel> GetOneDistributor(DistributorSearchDTO dto)
        {
            ResultData <DistributorModel> result = new ResultData <DistributorModel>();

            var pp = GetAPI <ResultData <List <DistributorModel> > >(WebConfiger.MasterDataServicesUrl + "DistributorManagerment?DistributorSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            if (pp.Object != null && pp.Object.Count > 0)
            {
                result.Object       = pp.Object.First();
                result.SubmitResult = true;
            }
            else
            {
                result.Message      = "此条信息不存在!";
                result.SubmitResult = false;
            }

            return(result);
        }
Exemplo n.º 16
0
        /// <summary>
        /// 得到经销商授权运输方式
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static List <DistributorTransportResultDTO> GetDistributorAuthorityTransport(DistributorAuthoritySearchDTO dto)
        {
            List <DistributorTransportResultDTO> result = null;

            result = GetAPI <List <DistributorTransportResultDTO> >(WebConfiger.MasterDataServicesUrl + "DistributorAuthorityTransport?DistributorAuthoritySearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(result);
        }
Exemplo n.º 17
0
        /// <summary>
        /// 经销商服务类型删除
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <object> DeleteDistributorServiceType(DistributorServiceTypeOperateDTO dto)
        {
            ResultData <object> blResult = DeleteAPI <ResultData <object> >(WebConfiger.MasterDataServicesUrl + "DistributorServiceType?DistributorServiceTypeOperateDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(blResult);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 得到一条经销商服务类型
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static ResultData <DistributorServiceTypeResultDTO> GetDistributorServiceType(DistributorServiceTypeSearchDTO dto)
        {
            ResultData <DistributorServiceTypeResultDTO> result = new ResultData <DistributorServiceTypeResultDTO>();

            var resultlist = GetAPI <List <DistributorServiceTypeResultDTO> >(WebConfiger.MasterDataServicesUrl + "DistributorServiceType?DistributorServiceTypeSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            if (resultlist.Count > 0)
            {
                result.Object       = resultlist.First();
                result.SubmitResult = true;
            }
            else
            {
                result.Message = "此条信息不存在!";
            }

            return(result);
        }
Exemplo n.º 19
0
 /// <summary>
 /// 导入经销商
 /// </summary>
 /// <param name="dto"></param>
 /// <returns></returns>
 public static ResultData <object> ImportDistributor(List <ExcelDistributorDTO> dto)
 {
     return(PostAPI <ResultData <object> >(WebConfiger.MasterDataServicesUrl + "ImportData", new { Data = TransformHelper.ConvertDTOTOBase64JsonString(dto), Type = 6 }));
 }
Exemplo n.º 20
0
 /// <summary>
 /// 导入维修产品价格
 /// </summary>
 /// <param name="regentprdlist"></param>
 /// <returns></returns>
 public static ResultData <object> ImportRepairPrice(List <ExcelRepairPriceDTO> implist)
 {
     return(PostAPI <ResultData <object> >(WebConfiger.MasterDataServicesUrl + "ImportData", new { Data = TransformHelper.ConvertDTOTOBase64JsonString(implist), Type = 5 }));
 }
Exemplo n.º 21
0
        /// <summary>
        /// 得到所有经销商信息
        /// </summary>
        /// <returns></returns>
        public static ResultData <List <DistributorModel> > GetDistributorList(DistributorSearchDTO dto, string strSaveDir = "")
        {
            ResultData <List <DistributorModel> > result = null;

            result = GetAPI <ResultData <List <DistributorModel> > >(WebConfiger.MasterDataServicesUrl + "DistributorManagerment?DistributorSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));
            if (strSaveDir != "")
            {
                foreach (var f in result.Object)
                {
                    var pp = System.IO.Directory.GetFiles(strSaveDir, f.DistributorID.Value.ToString("N") + ".*", System.IO.SearchOption.AllDirectories);
                    foreach (string p in pp)
                    {
                        f.IsAtt = true;
                    }
                }
            }

            return(result);
        }
Exemplo n.º 22
0
        /// <summary>
        /// 得到用户统计
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <List <UsersStatModel> > GetUsersStatList(UsersStatSearchDTO dto)
        {
            ResultData <List <UsersStatModel> > result = null;

            result = GetAPI <ResultData <List <UsersStatModel> > >(WebConfiger.MasterDataServicesUrl + "UsersStat?UsersStatSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(result);
        }
Exemplo n.º 23
0
        /// <summary>
        /// 经销商授权信息
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="ProductLineID"></param>
        /// <returns></returns>
        public static DistributorAuthorityResultDTO GetOneDistributorAuthority(DistributorAuthoritySearchDTO dto)
        {
            DistributorAuthorityResultDTO result = null;

            var pp = GetAPI <List <DistributorAuthorityResultDTO> >(WebConfiger.MasterDataServicesUrl + "DistributorAuthority?DistributorAuthoritySearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            result = pp.FirstOrDefault();

            return(result);
        }
Exemplo n.º 24
0
        /// <summary>
        /// 删除用户统计信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <object> DeleteUsersStat(UsersStatResultDTO dto)
        {
            ResultData <object> blResult = DeleteAPI <ResultData <object> >(WebConfiger.MasterDataServicesUrl + "UsersStat?UsersStatResultDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(blResult);
        }
Exemplo n.º 25
0
        /// <summary>
        /// 大小区显示/小区省份显示
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static List <AreaResultDTO> GetArea(AreaSearchDTO dto)
        {
            List <AreaResultDTO> arealist = null;

            arealist = GetAPI <List <AreaResultDTO> >(WebConfiger.MasterDataServicesUrl + "Area?AreaSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));
            foreach (var a in arealist)
            {
                foreach (var b in a.children)
                {
                    b.children.ForEach(f => { f.Ckid = true; });
                }
            }


            return(arealist);
        }
Exemplo n.º 26
0
        /// <summary>
        /// 得到反馈管理
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <List <FeedbackModel> > GetFeedbackList(FeedbackSearchDTO dto)
        {
            ResultData <List <FeedbackModel> > result = null;

            result = GetAPI <ResultData <List <FeedbackModel> > >(WebConfiger.MasterDataServicesUrl + "Feedback?FeedbackSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(result);
        }
Exemplo n.º 27
0
        /// <summary>
        /// 删除经销商信息
        /// </summary>
        /// <returns></returns>
        public static ResultData <object> DeleteDistributorAuthority(DistributorAuthorityOperateDTO dto)
        {
            ResultData <object> result = null;

            result = DeleteAPI <ResultData <object> >(WebConfiger.MasterDataServicesUrl + "DistributorAuthority?DistributorAuthorityOperateDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(result);
        }
Exemplo n.º 28
0
        /// <summary>
        /// 得到日志信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <List <LogDTO> > GetLog(LogSearchDTO dto)
        {
            ResultData <List <LogDTO> > result = null;

            result = GetAPI <ResultData <List <LogDTO> > >(WebConfiger.MasterDataServicesUrl + "Log?LogSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(result);
        }
Exemplo n.º 29
0
        /// <summary>
        /// 得到经销商OKC信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <List <DistributorOKCProduct> > GetDisOKCList(DistributorPriceAuthoritySearchDTO dto)
        {
            ResultData <List <DistributorOKCProduct> > result = null;

            result = GetAPI <ResultData <List <DistributorOKCProduct> > >(WebConfiger.MasterDataServicesUrl + "DistributorPriceAuthority?DistributorPriceAuthoritySearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(result);
        }
Exemplo n.º 30
0
        /// <summary>
        /// 得到所有模块管理员信息
        /// </summary>
        /// <returns></returns>
        public static ResultData <List <CustomerSysEamilModel> > GetModularList(UserSearchDTO dto)
        {
            ResultData <List <CustomerSysEamilModel> > result = new ResultData <List <CustomerSysEamilModel> >();

            var pp = GetAPI <ResultData <List <UserResultDTO> > >(WebConfiger.MasterDataServicesUrl + "UserManager?UserSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            result.Object = new List <CustomerSysEamilModel>();
            foreach (var p in pp.Object)
            {
                if (p.UserRolelist != null)
                {
                    foreach (var r in p.UserRolelist.Where(ur => ur.Value >= 2 && ur.Value <= 13).ToList())
                    {
                        foreach (var m in ModelRoleModel.ModelRolelist.Where(mr => mr.RoleID == r).Select(s => s.ModelName))
                        {
                            CustomerSysEamilModel cussys = new CustomerSysEamilModel();
                            result.Object.Add(cussys);
                            cussys.UserID   = p.UserID;
                            cussys.FullName = p.FullName;
                            cussys.Email    = p.Email;
                            cussys.Module   = m;
                        }
                    }
                }
            }

            return(result);
        }