Ejemplo n.º 1
0
 /// <summary>
 /// 根据部门id查单据
 /// </summary>
 /// <param name="departmentid"></param>
 /// <returns></returns>
 public ActionResult GetDateByDepartmentId(string departmentid, int billtype)
 {
     if (!String.IsNullOrEmpty(departmentid) && !String.IsNullOrEmpty(billtype.ToString()))
     {
         CostUnitList CostUnitListList = CostUnitListService.LoadEntities(a => a.DepartmentId == departmentid && a.BillType == billtype).FirstOrDefault();
         if (CostUnitListList == null)
         {
             return(Json(new CostUnitList()));
         }
         return(Json(CostUnitListList));
     }
     return(Json(new CostUnitList()));
 }
Ejemplo n.º 2
0
        //获取表单数据
        public ActionResult GetData()
        {
            if (Session["billType"] == null)//是否有单据类型
            {
                return(Content("没有单据类型!"));
            }
            string str = Request.Params["CostUnitListId"];//单号

            //如果新单据 没有数据
            if (string.IsNullOrEmpty(str))
            {
                return(Json(new CostUnitList()));//返回一个新建的空对象
            }
            int billtype = Convert.ToInt32(Session["billType"].ToString().Trim());
            //如果有数据
            Guid         CostUnitListId = new Guid(Request["CostUnitListId"]);                                                                      //单据编号
            CostUnitList bill           = CostUnitListService.LoadEntities(t => t.Id == CostUnitListId && t.BillType == billtype).FirstOrDefault(); //获取表单

            return(Json(bill));
        }