Пример #1
0
        public JsonResult AddConsumeItem()
        {
            string itemName = NullHelper.Convert<string>(Request["citemName"], "");
            decimal itemPrice = NullHelper.Convert<decimal>(Request["citemPrice"], 0M);

            ConsumeItemVO conItem = new ConsumeItemVO();
            conItem.ItemName = itemName;
            conItem.ItemPrice = itemPrice;
            conItem.LastModifiedDate = DateTime.Now;
            conItem.LastModifierID = Emp.UserName;
            conItem.CreatedDate = DateTime.Now;
            conItem.CreatorID = Emp.UserName;

            ReturnedData data = new ReturnedData();
            IConsumeItemMgm conMgm = new ConsumeItemMgm();
            try
            {
                conMgm.AddConsumeItem(conItem);
                data.Success = true;
                data.Message = "消费项目添加成功";
                LogHandler.Info("员工" + Emp.UserName + "添加一条消费项目,项目名:"+itemName );
            }
            catch(Exception ex)
            {
                data.Success = false;
                data.Message = "消费项目添加失败";
                LogHandler.Error("添加消费项目出现错误:" + (ex.Message.ToString()));
                data.Error = ex.ToString();
            }
            return Json(data,JsonRequestBehavior.AllowGet);
        }
Пример #2
0
        public ConsumeItemVO GetConsumeItemByID(int consumeItemID)
        {
            ConsumeItemData consumeItemData = new ConsumeItemData();
            ConsumeItemVO consumeItemVO = new ConsumeItemVO();
            ConsumeItemPO consumeItemPO = consumeItemData.GetConsumeItemByID(consumeItemID);
            consumeItemVO = Mapper.Map<ConsumeItemPO, ConsumeItemVO>(consumeItemPO);

            return consumeItemVO;
        }
Пример #3
0
 public void EditConsumeItem(ConsumeItemVO consumeItem)
 {
     throw new NotImplementedException();
 }
Пример #4
0
        public List<ConsumeItemVO> GetAllConsumeItems()
        {
            List<ConsumeItemVO> result = new List<ConsumeItemVO>();

            #region Mock
            var item1 = new ConsumeItemVO()
            {
                ItemName = "整车外部彻底清洁",
                ItemPrice = 55M
            };

            var item2 = new ConsumeItemVO()
            {
                ItemName = "整车的除锈、防锈、防腐蚀处理",
                ItemPrice = 78M
            };

            var item3 = new ConsumeItemVO()
            {
                ItemName = "玻璃彻底保养护理",
                ItemPrice = 52M
            };

            var item4 = new ConsumeItemVO()
            {
                ItemName = "发动机系统的美容护理",
                ItemPrice = 280M
            };

            var item5 = new ConsumeItemVO()
            {
                ItemName = "漆面美容护理",
                ItemPrice = 32M
            };

            var item6 = new ConsumeItemVO()
            {
                ItemName = "保险杠、车裙、挡泥板、车灯、底盘等保养护理",
                ItemPrice = 295M
            };

            var item7 = new ConsumeItemVO()
            {
                ItemName = "车内各部件及主要配置的保养护理",
                ItemPrice = 25M
            };

            var item8 = new ConsumeItemVO()
            {
                ItemName = "全车电光、镀铬表面去除氧化层抛光翻新",
                ItemPrice = 539M
            };

            var item9 = new ConsumeItemVO()
            {
                ItemName = "整车美容护理后的全面检查",
                ItemPrice = 23M
            };

            var item10 = new ConsumeItemVO()
            {
                ItemName = "贴防爆太阳膜",
                ItemPrice = 55M
            };

            var item11 = new ConsumeItemVO()
            {
                ItemName = "安装防盗器",
                ItemPrice = 51M
            };

            var item12 = new ConsumeItemVO()
            {
                ItemName = "安装静电放电器",
                ItemPrice = 25M
            };

            result.Add(item1);
            result.Add(item2);
            result.Add(item3);
            result.Add(item4);
            result.Add(item5);
            result.Add(item6);
            result.Add(item7);
            result.Add(item8);
            result.Add(item9);
            result.Add(item10);
            result.Add(item11);
            result.Add(item12);
            #endregion

            return result;
        }
Пример #5
0
        public void TestMethod4()
        {
            ConsumeItemVO entity = new ConsumeItemVO();
            entity.ItemName = "peng qi";
            entity.ItemPrice = 80M;

            entity.CreatedDate = DateTime.Now;
            entity.CreatorID = "001";
            entity.LastModifiedDate = DateTime.Now;
            entity.LastModifierID = "002";
            entity.LogicalStatus = 1;

            //VO to PO
            Mapper.CreateMap<ConsumeItemVO, ConsumeItemPO>();

            ConsumeItemMgm consumeItemMgm = new ConsumeItemMgm();

            consumeItemMgm.AddConsumeItem(entity);
        }