예제 #1
0
        public void Delete(string id)
        {
            var service = new mms_drainpipeductService();
            var result  = service.Delete(ParamDelete.Instance().AndWhere("BillNo", id));

            MmsHelper.ThrowHttpExceptionWhen(result <= 0, "信息删除失败[BillNo={0}],请重试或联系管理员!", id);
        }
예제 #2
0
        // 查询主表:GET api/mms/send
        public dynamic Get(RequestWrapper query)
        {
            query.LoadSettingXmlString(@"
<settings defaultOrderBy='BillNo'>
    <select>
     A.*
    </select>
    <from>
        mms_drainpipeduct A
    </from>
    <where defaultForAll='true' defaultCp='equal' defaultIgnoreEmpty='true' >
        <field name='BillNo'          cp='equal'      ></field>
        <field name='Address'        cp='like'       ></field>
        <field name='IdentificationCode'            cp='like'       ></field>
        <field name='Category'            cp='like'       ></field>
        <field name='Material'            cp='like'       ></field>
        <field name='PressureType'            cp='like'       ></field>
       <field name='OwnershipUnit'            cp='like'       ></field>
       <field name='Diameter'            cp='like'       ></field>
    </where>
</settings>");
            var service = new mms_drainpipeductService();
            var pQuery  = query.ToParamQuery().AndWhere("A.ProjectCode", MmsHelper.GetCurrentProject());

            return(service.GetDynamicListWithPaging(pQuery));
        }
예제 #3
0
        public List <dynamic> GetBillNo(string q)
        {
            var service = new mms_drainpipeductService();
            var pQuery  = ParamQuery.Instance().Select("top 10 BillNo").AndWhere("BillNo", q, Cp.StartWith);

            return(service.GetDynamicList(pQuery));
        }
예제 #4
0
        // GET api/mms/send/getdoperson
        public List <dynamic> GetDoPerson(string q)
        {
            var SendService = new mms_drainpipeductService();
            var pQuery      = ParamQuery.Instance().Select("top 10 DoPerson").AndWhere("DoPerson", q, Cp.StartWithPY);

            return(SendService.GetDynamicList(pQuery));
        }
예제 #5
0
        public dynamic GetEditMaster(string id)
        {
            var service = new mms_drainpipeductService();

            return(new
            {
                form = service.GetModel(ParamQuery.Instance().AndWhere("BillNo", id)),
                scrollKeys = service.ScrollKeys("BillNo", id, ParamQuery.Instance().AndWhere("ProjectCode", MmsHelper.GetCurrentProject()))
            });
        }
예제 #6
0
        public void Edit(dynamic data)
        {
            var service     = new mms_drainpipeductService();
            var formWrapper = RequestWrapper.Instance().LoadSettingXmlString(@"
<settings>
    <table>mms_drainpipeduct</table>
    <where>
        <field name='BillNo' cp='equal'></field>
    </where>
</settings>");

            var result = service.Edit(formWrapper, null, data);
        }
예제 #7
0
        public dynamic GetDetail(string id)
        {
            var ReceiveService = new mms_drainpipeductService();
            var query          = RequestWrapper
                                 .InstanceFromRequest()
                                 .SetRequestData("CustomerId", id)
                                 .LoadSettingXmlString(@"
<settings defaultOrderBy='UpdateDate desc'>
    <select>
        A.*
    </select>
    <from>
        psi_customerContract A
    </from>
    <where>
        <field name='CustomerId' cp='equal'></field>
    </where>
</settings>");

            var pQuery1 = query.ToParamQuery();

            query.LoadSettingXmlString(@"
<settings defaultOrderBy='VisitId desc'>
    <select>
        A.*
    </select>
    <from>
        psi_customerVisit A
    </from>
    <where>
        <field name='CustomerId' cp='equal'></field>
    </where>
</settings>");

            var pQuery2 = query.ToParamQuery();
            var result  = ReceiveService.GetDynamicListWithPaging(pQuery2);

            return(result);
        }
예제 #8
0
        public string GetNewBillNo()
        {
            var service = new mms_drainpipeductService();

            return(service.GetNewKey("BillNo", "dateplus"));
        }