예제 #1
0
 public AppealInfoItems(AppealInfo appealInfo)
 {
     RowNumber       = appealInfo.RowNumber;
     RecordReference = appealInfo.RecordReference;
     Appealint       = appealInfo.Appealint;
     AppealState     = appealInfo.AppealState;
     ReferenceID     = appealInfo.ReferenceID;
     AppealTime      = appealInfo.AppealTime;
     AgentNum        = appealInfo.AgentID;
     AgentID         = AgentNum.ToString();
     AgentName       = appealInfo.AgentName;
     TemplateID      = appealInfo.TemplateID;
     TemplateName    = appealInfo.TemplateName;
     Score           = appealInfo.Score;
     ScoreID         = appealInfo.ScoreID;
 }
예제 #2
0
        public async Task <APIResult> AppealInfoSearch(int aPId)
        {
            try
            {
                string spName = @"up_MBMS_APP_AppealInfoSearch_R";

                DynamicParameters dp = new DynamicParameters();
                dp.Add("@APId", aPId, DbType.Int32);

                using (var conn = new SqlConnection(DapperContext.Current.SqlConnection))
                {
                    conn.Open();

                    var list = await conn.QueryMultipleAsync(spName, dp, null, null, CommandType.StoredProcedure);

                    var r1 = list.ReadAsync().Result;
                    var r2 = list.ReadAsync().Result;
                    var r3 = list.ReadAsync().Result;

                    List <AppealInfo>       lst  = JsonConvert.DeserializeObject <List <AppealInfo> >(JsonConvert.SerializeObject(r1));
                    List <AttachmentMngDto> lst2 = JsonConvert.DeserializeObject <List <AttachmentMngDto> >(JsonConvert.SerializeObject(r2));
                    List <AttachmentMngDto> lst3 = JsonConvert.DeserializeObject <List <AttachmentMngDto> >(JsonConvert.SerializeObject(r3));

                    AppealInfo dto = lst.FirstOrDefault <AppealInfo>();
                    dto.AttachmentList    = lst2;
                    dto.ApproalAttachList = lst3;

                    string message = "";
                    if (lst.Count == 0)
                    {
                        message = "没有数据";
                    }
                    APIResult result = new APIResult {
                        Body = CommonHelper.EncodeDto <AppealInfo>(dto), ResultCode = ResultType.Success, Msg = message
                    };
                    return(result);
                }
            }
            catch (Exception ex)
            {
                return(new APIResult {
                    Body = "", ResultCode = ResultType.Failure, Msg = ex.Message
                });
            }
        }
예제 #3
0
        public async Task <APIResult> AppealInfoReg(AppealInfo param)
        {
            string            AttachmentList = CommonHelper.Serializer(typeof(List <AttachmentMngDto>), param.AttachmentList);
            string            spName         = @"up_MBMS_APP_AppealInfoReg_C";
            DynamicParameters dp             = new DynamicParameters();

            dp.Add("@TPId", param.TPId, DbType.Int32);
            dp.Add("@TIId", param.TIId, DbType.Int32);
            dp.Add("@AppealContent", param.AppealContent, DbType.String);
            dp.Add("@ApprealUserId", param.ApprealUserId, DbType.Int32);

            dp.Add("@AttachmentList", AttachmentList, DbType.Xml);

            using (var conn = new SqlConnection(DapperContext.Current.SqlConnection))
            {
                conn.Open();
                using (var tran = conn.BeginTransaction(System.Data.IsolationLevel.ReadCommitted))
                {
                    try
                    {
                        await conn.ExecuteAsync(spName, dp, tran, null, CommandType.StoredProcedure);

                        tran.Commit();
                    }
                    catch (Exception ex)
                    {
                        tran.Rollback();
                        return(new APIResult {
                            Body = "", ResultCode = ResultType.Failure, Msg = ex.Message
                        });
                    }
                    finally
                    {
                        tran.Dispose();
                    }
                }
                return(new APIResult {
                    Body = "", ResultCode = ResultType.Success, Msg = ""
                });
            }
        }
예제 #4
0
        public void QueryAppealInfo(string strCondition, List <DateTimeSpliteAsDay> lstDateTimeSplitAsDay)
        {
            mListAllAppealInfo.Clear();
            mListCurrentAppealItems.Clear();
            mListAppealInfoItems = null;
            mRecordTotal         = 0;
            mPageIndex           = 0;
            mPageCount           = 0;
            mPageSize            = S3105Consts.USER_PARAM_PAGESIZE;
            mMaxRecords          = S3105Consts.USER_PARAM_MAXRECORDS;
            try
            {
                PanelBasicOpts.IsEnabled = false;
                PanelOtherOpts.IsEnabled = false;
                SetBusy(true, string.Empty);
                mWorker = new BackgroundWorker();
                //注册线程主体方法
                mWorker.DoWork += (s, de) =>
                {
                    CurrentApp.WriteLog("QueryRecord", string.Format("{0}", strCondition));

                    WebRequest webRequest = new WebRequest();
                    webRequest.Session = CurrentApp.Session;
                    webRequest.Code    = (int)S3105Codes.GetAppealInfoData;
                    webRequest.ListData.Add(strCondition);
                    //Service31051Client client = new Service31051Client();
                    Service31051Client client    = new Service31051Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31051"));
                    WebReturn          webReturn = client.UMPTaskOperation(webRequest);
                    client.Close();
                    if (!webReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }
                    if (webReturn.ListData == null)
                    {
                        ShowException(CurrentApp.GetLanguageInfo("3105T00101", string.Format("ListData is null")));
                        return;
                    }
                    if (webReturn.ListData.Count <= 0)
                    {
                        SetPageState();
                        return;
                    }
                    for (int i = 0; i < webReturn.ListData.Count; i++)
                    {
                        OperationReturn optReturn = XMLHelper.DeserializeObject <AppealInfo>(webReturn.ListData[i]);
                        if (!optReturn.Result)
                        {
                            ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            continue;
                        }
                        AppealInfo appealInfo = optReturn.Data as AppealInfo;
                        if (appealInfo == null)
                        {
                            ShowException(CurrentApp.GetLanguageInfo("3105T00101", string.Format("ListData is null")));
                            return;
                        }
                        AppealInfoItems item = new AppealInfoItems(appealInfo);
                        mRecordTotal    = item.RowNumber;
                        item.Background = GetRecordBackground(item);
                        if (item.Appealint > 0)
                        {
                            item.AppealState = CurrentApp.GetLanguageInfo(string.Format("3105T000{0}", 77 + item.Appealint), item.Appealint.ToString());
                        }
                        if (item.AgentNum != 0)
                        {
                            item.AgentName = AgentAndUserFullName(item.AgentNum);
                            item.AgentID   = AgentAndUserName(item.AgentNum);
                        }
                        mListAllAppealInfo.Add(item);
                        if (mRecordTotal < mPageSize + 1)
                        {
                            AddNewAppealInfo(item);
                        }
                    }
                    SetPageState();
                };
                //当后台操作已完成、被取消或引发异常时发生
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    SetBusy(false, string.Empty);
                    PanelBasicOpts.IsEnabled = true;
                    PanelOtherOpts.IsEnabled = true;
                };
                mWorker.RunWorkerAsync();//触发DoWork事件
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
                CurrentApp.WriteOperationLog(S3105Consts.OPT_Query.ToString(), ConstValue.OPT_RESULT_FAIL, "");
            }
            #region 写操作日志
            CurrentApp.WriteOperationLog(S3105Consts.OPT_Query.ToString(), ConstValue.OPT_RESULT_SUCCESS, "");
            #endregion
        }
예제 #5
0
 public Task <APIResult> AppealInfoReg([FromBody] AppealInfo param)
 {
     return(_appealMngService.AppealInfoReg(param));
 }