Ejemplo n.º 1
0
        public void Edit(dynamic data)
        {
            var formWrapper = RequestWrapper.Instance().LoadSettingXmlString(@"
<settings>
    <table>
        psi_customer
    </table>
    <where>
        <field name='Id' cp='equal'></field>
    </where>
</settings>");

            var listWrapper = RequestWrapper.Instance().LoadSettingXmlString(@"
<settings>
    <table>
        psi_customerContract
    </table>
    <where>
        <field name='ContractNo' cp='equal'></field>
    </where>
</settings>");

            var service = new psi_customerService();
            var result  = service.Edit(formWrapper, listWrapper, data);
        }
Ejemplo n.º 2
0
        public dynamic GetEditMaster(string id)
        {
            dynamic result        = new ExpandoObject();
            var     masterService = new psi_customerService();

            result.form       = masterService.GetModel(ParamQuery.Instance().AndWhere("Id", id));
            result.form.Id    = id; //如果没有数据,返回一条空数据,Id=id; 对应新增的情况
            result.scrollKeys = masterService.ScrollKeys("Id", id);
            return(result);
        }
Ejemplo n.º 3
0
        public void Delete(string id)
        {
            var service = new psi_customerService();
            var result  = service.Delete(ParamDelete.Instance().AndWhere("Id", id));

            if (result <= 0)
            {
                throw new HttpResponseException(new HttpResponseMessage()
                {
                    Content = new StringContent("收货单删除失败{Id=" + id + "},请重试或联系管理员!")
                });
            }
        }
Ejemplo n.º 4
0
        public void Audit(string id, dynamic data)
        {
            var service = new psi_customerService();
            var result  = service.Update(ParamUpdate.Instance()
                                         .Column("AuditState", data.status)
                                         .Column("AuditReason", data.comment)
                                         .Column("AuditPerson", FormsAuth.GetUserData().UserName)
                                         .Column("AuditDate", DateTime.Now)
                                         .AndWhere("Id", id));

            if (result <= 0)
            {
                throw new HttpResponseException(new HttpResponseMessage()
                {
                    Content = new StringContent("审核收货单失败{Id=" + id + "},请重试或联系管理员!")
                });
            }
        }
Ejemplo n.º 5
0
        public dynamic GetDetail(string id)
        {
            var ReceiveService = new psi_customerService();
            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 = new {
            //    contract: ReceiveService.GetDynamicListWithPaging(pQuery1),
            //    visit:ReceiveService.GetDynamicListWithPaging(pQuery2)
            //};
            var result = ReceiveService.GetDynamicListWithPaging(pQuery1);

            return(result);
        }
Ejemplo n.º 6
0
        public dynamic Get(RequestWrapper query)
        {
            query.LoadSettingXmlString(@"
<settings defaultOrderBy='Id'>
    <select>
        A.*
    </select>
    <from>
        psi_customer A
    </from>
    <where defaultForAll='true' defaultCp='equal' defaultIgnoreEmpty='true' >
        <field name='Name'          cp='like'       ></field>
        <field name='ChargePerson'  cp='like'       ></field>
        <field name='Catagory'      cp='like'></field>
        <field name='MainService'   cp='like' ></field>
    </where>
</settings>");

            var ReceiveService = new psi_customerService();
            var pQuery         = query.ToParamQuery();
            var result         = ReceiveService.GetDynamicListWithPaging(pQuery);

            return(result);
        }
Ejemplo n.º 7
0
        public void Edit(dynamic data)
        {
            var formWrapper = RequestWrapper.Instance().LoadSettingXmlString(@"
<settings>
    <table>
        psi_customer
    </table>
    <where>
        <field name='Id' cp='equal'></field>
    </where>
</settings>");

            var listWrapper = RequestWrapper.Instance().LoadSettingXmlString(@"
<settings>
    <table>
        psi_customerContract
    </table>
    <where>
        <field name='ContractNo' cp='equal'></field>
    </where>
</settings>");
             
            var service = new psi_customerService();
            var result = service.Edit(formWrapper, listWrapper, data);
        }
Ejemplo n.º 8
0
        public dynamic GetDetail(string id)
        {
            var ReceiveService = new psi_customerService();
            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 = new {
            //    contract: ReceiveService.GetDynamicListWithPaging(pQuery1),
            //    visit:ReceiveService.GetDynamicListWithPaging(pQuery2)
            //};
            var result = ReceiveService.GetDynamicListWithPaging(pQuery1);
            return result;
        }
Ejemplo n.º 9
0
 public dynamic GetEditMaster(string id) {
     dynamic result = new ExpandoObject();
     var masterService = new psi_customerService();
     result.form = masterService.GetModel(ParamQuery.Instance().AndWhere("Id", id));
     result.form.Id = id; //如果没有数据,返回一条空数据,Id=id; 对应新增的情况
     result.scrollKeys = masterService.ScrollKeys("Id", id);
     return result;
 }
Ejemplo n.º 10
0
        public void Audit(string id, dynamic data)
        {
            var service = new psi_customerService();
            var result = service.Update(ParamUpdate.Instance()
                .Column("AuditState", data.status)
                .Column("AuditReason", data.comment)
                .Column("AuditPerson", FormsAuth.GetUserData().UserName)
                .Column("AuditDate", DateTime.Now)
                .AndWhere("Id", id));

            if (result <= 0)
                throw new HttpResponseException(new HttpResponseMessage() { Content = new StringContent("审核收货单失败{Id=" + id + "},请重试或联系管理员!") });
        }
Ejemplo n.º 11
0
 public void Delete(string id)
 {
     var service = new psi_customerService();
     var result = service.Delete(ParamDelete.Instance().AndWhere("Id", id));
     if (result <= 0)
         throw new HttpResponseException(new HttpResponseMessage() { Content = new StringContent("收货单删除失败{Id=" + id + "},请重试或联系管理员!") });
 }
Ejemplo n.º 12
0
 public string GetNewId()
 {
     var service = new psi_customerService();
     return service.GetNewKey("Id", "dateplus");
 }
Ejemplo n.º 13
0
        public dynamic Get(RequestWrapper query)
        {
            query.LoadSettingXmlString(@"
<settings defaultOrderBy='Id'>
    <select>
        A.*
    </select>
    <from>
        psi_customer A
    </from>
    <where defaultForAll='true' defaultCp='equal' defaultIgnoreEmpty='true' >
        <field name='Name'          cp='like'       ></field>
        <field name='ChargePerson'  cp='like'       ></field>
        <field name='Catagory'      cp='like'></field>
        <field name='MainService'   cp='like' ></field>
    </where>
</settings>");  

            var ReceiveService = new psi_customerService();
            var pQuery = query.ToParamQuery();
            var result = ReceiveService.GetDynamicListWithPaging(pQuery);
            return result;
        }
Ejemplo n.º 14
0
        public string GetNewId()
        {
            var service = new psi_customerService();

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