Ejemplo n.º 1
0
        public bool Create(WxPostCaseViewModel model)
        {
            CaseService dbcase   = new CaseService();
            M_Case      caseitem = new M_Case()
            {
                CaseOfSubmit    = DateTime.Now,
                Complainant     = model.accuser,
                ComplainantId   = model.accuserid,
                DateOfBegin     = DateTime.Now,
                DateOfEnd       = DateTime.Now.AddDays(10),
                originalpay     = model.originalpay,
                Publisher       = model.accuser,
                PublisherId     = model.accuserid,
                Respondent      = model.respondent,
                RespondentId    = model.respondentid,
                StatementOfCase = model.description,
                StateOfCase     = model.state,
                Title           = model.title,
                OtherPay1       = model.otherPay1,
                OtherPay2       = model.otherPay2,
                OtherPay3       = model.otherPay3,
            };
            var result = dbcase.AddEntity(caseitem);

            if (result.ID != 0)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 发布案件
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int PublishCase(casepublist model)
        {
            CaseService dbcase = new CaseService();

            //应诉人是站内的用户
            if (model.respondentid != null)
            {
                M_Case caseitem = new M_Case
                {
                    CaseOfSubmit    = DateTime.Now,
                    Complainant     = model.publishname,
                    ComplainantId   = model.publishid,
                    DateOfBegin     = DateTime.Now,
                    DateOfEnd       = DateTime.Now.AddDays(10),
                    originalpay     = int.Parse(model.paynum),
                    Publisher       = model.publishname,
                    PublisherId     = model.publishid,
                    Respondent      = model.respondent,
                    RespondentId    = model.respondentid,
                    StatementOfCase = model.content,
                    StateOfCase     = model.savemod == "保存"?WholeSituation.CaseState.DRAFT:WholeSituation.CaseState.PUBLISH,
                    Title           = model.casetitle,
                    OtherPay1       = model.paymod1,
                    OtherPay2       = model.paymod2,
                    OtherPay3       = model.paymod3,
                };
                var result = dbcase.AddEntity(caseitem);
                if (result.ID != 0)
                {
                    return(1);
                }
            }
            //应诉人是手写的用户 没有应诉人id
            else
            {
                M_Case caseitem = new M_Case
                {
                    CaseOfSubmit      = DateTime.Now,
                    Complainant       = model.publishid,
                    ComplainantId     = model.publishid,
                    DateOfBegin       = DateTime.Now,
                    DateOfEnd         = DateTime.Now.AddDays(10),
                    originalpay       = int.Parse(model.paynum),
                    Publisher         = model.publishname,
                    PublisherId       = model.publishid,
                    Respondent        = model.respondent,
                    RespondentEmail   = model.respondentEmail,
                    RespondentAddress = model.respondentAddress,
                    RespondentPhone   = model.respondentPhone,
                    StatementOfCase   = model.content,
                    StateOfCase       = model.savemod == "保存" ? WholeSituation.CaseState.DRAFT : WholeSituation.CaseState.PUBLISH,
                    Title             = model.casetitle,
                    OtherPay1         = model.paymod1,
                    OtherPay2         = model.paymod2,
                    OtherPay3         = model.paymod3,
                };
                var result = dbcase.AddEntity(caseitem);
                if (result.ID != 0)
                {
                    return(1);
                }
            }
            return(1);
        }