Exemplo n.º 1
0
        public dynamic GetModelType()
        {
            var service = new APS_BN_DispatchModelMainService();
            var pQuery  = ParamQuery.Instance().Paging(1, 100).AndWhere("IsEnable", 1);
            var result  = service.GetDynamicListWithPaging(pQuery);

            return(result);
        }
Exemplo n.º 2
0
        //todo 改成支持多个Tab
        // 地址:GET api/mms/@(controller)/getnewrowid 预取得新的明细表的行号
        public string GetNewRowId(string type, string key, int qty = 1)
        {
            switch (type)
            {
            case "grid0":
                var service0 = new APS_BN_DispatchModelMainService();
                return(service0.GetNewKey("ID", "maxplus", qty, ParamQuery.Instance().AndWhere("ID", key, Cp.Equal)));

            default:
                return("");
            }
        }
Exemplo n.º 3
0
        public void Audit(string id, JObject data)
        {
            var pUpdate = ParamUpdate.Instance()
                          .Update("APS_BN_DispatchModelMain")
                          .Column("ApproveState", data["status"])
                          .Column("ApproveRemark", data["comment"])
                          .Column("ApprovePerson", FormsAuth.GetUserData().UserName)
                          .Column("ApproveDate", DateTime.Now)
                          .AndWhere("ID", id);

            var service      = new APS_BN_DispatchModelMainService();
            var rowsAffected = service.Update(pUpdate);

            MmsHelper.ThrowHttpExceptionWhen(rowsAffected < 0, "单据审核失败[BillNo={0}],请重试或联系管理员!", id);
        }
Exemplo n.º 4
0
        public dynamic Get(RequestWrapper query)
        {
            query.LoadSettingXmlString(@"
<settings defaultOrderBy='ID'>
    <select>*</select>
    <from>APS_BN_DispatchModelMain</from>
    <where defaultForAll='true' defaultCp='equal' defaultIgnoreEmpty='true' >
        <field name='Name'		cp='like'></field>   
    </where>
</settings>");
            var service = new APS_BN_DispatchModelMainService();
            var pQuery  = query.ToParamQuery();
            var result  = service.GetDynamicListWithPaging(pQuery);

            return(result);
        }
Exemplo n.º 5
0
        public dynamic GetPageData(string id)
        {
            var masterService = new APS_BN_DispatchModelMainService();
            var pQuery        = ParamQuery.Instance().AndWhere("ID", id);

            //var result = new
            //{
            //    //主表数据
            //    form = masterService.GetModel(pQuery),
            //    scrollKeys = masterService.ScrollKeys("ID", id),

            //    //明细数据
            //    tab0 = new APS_BN_DispatchModelDetailService().GetDynamicList(ParamQuery.Instance().AndWhere("MainID", id))
            //};
            //return result;
            var mainData = masterService.GetModel(pQuery);

            if (mainData != null)
            {
                var pQuery2 = ParamQuery.Instance().AndWhere("MainID", mainData.ID);

                var result = new
                {
                    //主表数据
                    form       = mainData,
                    scrollKeys = masterService.ScrollKeys("ID", id),
                    //明细数据
                    tab0 = new APS_BN_DispatchModelDetailService().GetDynamicList(pQuery2),
                };
                return(result);
            }
            else
            {
                var result = new
                {
                    //主表数据
                    form       = mainData,
                    scrollKeys = masterService.ScrollKeys("ID", id),
                    //明细数据
                    tab0 = "",
                    tab1 = ""
                };
                return(result);
            }
        }