Пример #1
0
    protected void Initalize()
    {
        string    strA      = base.Request["type"];
        DataTable dataTable = null;

        if (string.Compare(strA, "edit", true) == 0)
        {
            string text = base.Request["reportId"];
            if (!string.IsNullOrWhiteSpace(text))
            {
                Report byId = Report.GetById(text);
                if (byId != null)
                {
                    this.txtDate.Text          = byId.InputDate.Value.ToString("yyyy-M-d");
                    this.txtInputUser.Text     = PageHelper.QueryUser(this, byId.InputUser);
                    this.hfldInputUser.Value   = byId.InputUser;
                    this.txtWorkCard.InnerText = byId.Note;
                    this.hfldReportId.Value    = byId.Id;
                }
                dataTable = ReportDetail.GetDetails(text);
                this.ViewState["PTasks"] = dataTable;
            }
        }
        else
        {
            this.txtDate.Text        = System.DateTime.Now.ToString("yyyy-M-d");
            this.txtInputUser.Text   = PageHelper.QueryUser(this, base.UserCode);
            this.hfldInputUser.Value = base.UserCode;
            this.hfldReportId.Value  = System.Guid.NewGuid().ToString();
        }
        this.Bind(dataTable);
        this.FileUpload1.RecordCode = this.hfldReportId.Value;
    }
Пример #2
0
        public ReportDetail CreateReportDetail(Report report, bool includeCancelledParts, IPersistenceContext context)
        {
            ReportDetail detail = new ReportDetail();

            detail.ReportRef    = report.GetRef();
            detail.ReportStatus = EnumUtils.GetEnumValueInfo(report.Status, context);

            ProcedureAssembler rpAssembler = new ProcedureAssembler();

            detail.Procedures = CollectionUtils.Map <Procedure, ProcedureDetail>(report.Procedures,
                                                                                 delegate(Procedure p)
            {
                return(rpAssembler.CreateProcedureDetail(
                           p,
                           delegate(ProcedureStep ps) { return ps.Is <ReportingProcedureStep>(); }, // only Reporting steps are relevant
                           false,                                                                   // exclude protocols
                           context));
            });

            List <ReportPartDetail> parts = CollectionUtils.Map <ReportPart, ReportPartDetail>(report.Parts,
                                                                                               delegate(ReportPart part) { return(CreateReportPartDetail(part, context)); });

            detail.Parts = includeCancelledParts ? parts :
                           CollectionUtils.Select(parts,
                                                  delegate(ReportPartDetail rpp)
            {
                return(rpp.Status.Code.Equals(ReportPartStatus.X.ToString()) == false);
            });

            return(detail);
        }
Пример #3
0
 public LoadReportForEditResponse(ReportDetail report, int reportPartIndex, OrderDetail order, List <EnumValueInfo> priorityChoices)
 {
     Report          = report;
     ReportPartIndex = reportPartIndex;
     Order           = order;
     PriorityChoices = priorityChoices;
 }
Пример #4
0
        public IHttpActionResult GetSpecificReport(int reportId)
        {
            ReportDetail reportDetail = null;
            ActionStatus status       = new ActionStatus();

            try
            {
                reportDetail = reportService.GetSpecificReport(reportId, permission);
                if (reportDetail == null)
                {
                    throw new NoDataFoundException();
                }
            }
            catch (BaseException ex)
            {
                status.Number = (int)ex.ErrorCode;
            }
            catch (Exception ex)
            {
                status.Number = -1;
                logger.Error("Exception in Report/GetSpecificReport: {0} \r\n {1}", ex.ToString(), ex.StackTrace);
            }
            if (status.Number != -1)
            {
                return(Ok(new { reportDetail = reportDetail, Status = status }));
            }
            else
            {
                return(InternalServerError());
            }
        }
Пример #5
0
    protected void BindReportDetails(string reportId)
    {
        DataTable details = ReportDetail.GetDetails(reportId);

        this.gvwReportDetails.DataSource = details;
        this.gvwReportDetails.DataBind();
    }
Пример #6
0
		public LoadReportForEditResponse(ReportDetail report, int reportPartIndex, OrderDetail order, List<EnumValueInfo> priorityChoices)
    	{
    		Report = report;
    		ReportPartIndex = reportPartIndex;
    		Order = order;
			PriorityChoices = priorityChoices;
    	}
Пример #7
0
        public IHttpActionResult UpdateReport(ReportDetail reportDetail)
        {
            int          result = 0;
            ActionStatus status = new ActionStatus();

            try
            {
                result = reportService.UpdateReport(reportDetail, permission);
            }
            catch (BaseException ex)
            {
                status.Number = (int)ex.ErrorCode;
            }
            catch (Exception ex)
            {
                status.Number = -1;
                logger.Error("Exception in Report/UpdateReport: {0} \r\n {1}", ex.ToString(), ex.StackTrace);
            }

            if (status.Number != -1)
            {
                return(Ok(new { result = result, Status = status }));
            }
            else
            {
                return(InternalServerError());
            }
        }
Пример #8
0
 public MessageDetailTableEntity(string engagementAccount, string messageId, ReportDetail report)
     : this(engagementAccount, messageId, report.PhoneNumber)
 {
     this.State       = report.State.ToString();
     this.SubmitTime  = report.SubmitTime;
     this.ReceiveTime = report.ReceiveTime;
     this.StateDetail = report.StateDetail;
 }
Пример #9
0
        public ActionResult Index()
        {
            ReportDetail report = new ReportDetail();

            report.Parameter          = new Parameter();
            report.Parameter.ToDate   = DateTime.Now.ToString("dd/MM/yyyy");
            report.Parameter.FromDate = DateTime.Now.Date.AddMonths(-1).ToString("dd/MM/yyyy");
            return(View(report));
        }
Пример #10
0
        public IActionResult Update(ReportDetail reportDetail)
        {
            var result = _reportDetailService.Update(reportDetail);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Пример #11
0
        public object Reports(
            [FromQuery][Range(1, 10000)] int?page,
            [FromServices] AppDbContext context)
        {
            var reports =
                from r in context.Reports.Include(r => r.HandledBy)
                orderby r.Date descending
                select ReportDetail.FromReport(r);

            return(reports.Page(page ?? 1));
        }
Пример #12
0
    private void DataBindResource()
    {
        string    text       = base.Request["proVerId"];
        DataTable dataSource = null;

        if (!string.IsNullOrEmpty(text))
        {
            dataSource = ReportDetail.GetTreeTask(text);
        }
        this.gvBudget.DataSource = dataSource;
        this.gvBudget.DataBind();
    }
Пример #13
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        string value = this.hfldReportId.Value;

        System.DateTime?inputDate = null;
        if (!string.IsNullOrEmpty(this.txtDate.Text))
        {
            inputDate = new System.DateTime?(System.Convert.ToDateTime(this.txtDate.Text));
        }
        string value2    = this.hfldInputUser.Value;
        string innerText = this.txtWorkCard.InnerText;
        string proVerId  = base.Request["id"];

        System.Collections.Generic.List <ReportDetail> list = new System.Collections.Generic.List <ReportDetail>();
        foreach (GridViewRow gridViewRow in this.gvwTask.Rows)
        {
            string          id      = this.gvwTask.DataKeys[gridViewRow.RowIndex]["Id"].ToString();
            string          taskUID = this.gvwTask.DataKeys[gridViewRow.RowIndex]["TaskUID"].ToString();
            System.DateTime?start   = null;
            string          text    = (gridViewRow.Cells[6].FindControl("txtStartDate") as TextBox).Text;
            if (!string.IsNullOrEmpty(text))
            {
                start = new System.DateTime?(System.Convert.ToDateTime(text));
            }
            System.DateTime?finish = null;
            string          text2  = (gridViewRow.Cells[7].FindControl("txtFinshDate") as TextBox).Text;
            if (!string.IsNullOrEmpty(text2))
            {
                finish = new System.DateTime?(System.Convert.ToDateTime(text2));
            }
            byte   completed = 0;
            string text3     = (gridViewRow.Cells[8].FindControl("txtCompleteQuantity") as TextBox).Text;
            if (!string.IsNullOrEmpty(text3))
            {
                completed = System.Convert.ToByte(text3);
            }
            string       text4 = (gridViewRow.FindControl("txtNoet") as TextBox).Text;
            ReportDetail item  = ReportDetail.Create(id, value, taskUID, start, finish, completed, text4);
            list.Add(item);
        }
        string strA = base.Request["type"];

        if (string.Compare(strA, "add", true) == 0)
        {
            this.AddReport(value, inputDate, value2, innerText, proVerId, list);
        }
        else
        {
            this.EditReport(value, inputDate, value2, innerText, list);
        }
        base.RegisterScript("CloseTab();");
    }
        public void DeleteReport(ReportDetail report)
        {
            if (report == null)
            {
                throw new ArgumentNullException(nameof(report));
            }

            //report.Deleted = true;
            UpdateReport(report);

            //event notification
            _eventPublisher.EntityDeleted(report);
        }
        public void InsertReport(ReportDetail report)
        {
            if (report == null)
            {
                throw new ArgumentNullException(nameof(report));
            }

            _reportRepository.Insert(report);

            //cache
            //_cacheManager.RemoveByPattern(ORDERS_PATTERN_KEY);

            //event notification
            _eventPublisher.EntityInserted(report);
        }
Пример #16
0
        //私有--创建详细节点
        private XmlElement GetReportDetailElement(XmlDocument doc, ReportDetail rd, string tagName)
        {
            XmlElement eleTag = doc.CreateElement(tagName);

            string[] tags = { AppUtils.Tag_Payment_MC, AppUtils.Tag_Payment_DW, AppUtils.Tag_Payment_CKJG,
                              AppUtils.Tag_Payment_TS, AppUtils.Tag_Payment_JG };
            foreach (string tag in tags)
            {
                string     value    = rd.getValue(tag);
                XmlElement eleValue = doc.CreateElement(tag);
                eleValue.InnerText = (null != value) ? value : "";
                eleTag.AppendChild(eleValue);
            }

            return(eleTag);
        }
Пример #17
0
 public virtual ActionResult HandleReportSend(ReportDetail input)
 {
     try
     {
         DomainRegistry.Repository.Execute(new HandleReport
         {
             ModeratorResponse = input.ModeratorResponse,
             ReportId          = input.Id
         });
     }
     catch (DomainException e)
     {
         TempData["Error"] = "Error: " + e.Message;
         return(RedirectToAction(MVC.PvP.Play()));
     }
     TempData["Result"] = "You have replied to this report.";
     return(RedirectToAction(MVC.Moderator.ViewReports()));
 }
Пример #18
0
    //rapora ait constructor reports tablosundan satırdaki bilgileri alır
    public Reports(DataRow row)
    {
        Id = Convert.ToInt32(row["Id"]);
        AssignedActivityId = Convert.ToInt32(row["AssignedActivityId"]);
        ActivityId         = Convert.ToInt32(row["ActivityId"]);
        StudentId          = Convert.ToInt32(row["StudentId"]);

        Stage    = row["Stage"].ToString();
        Grade    = row["Grade"].ToString();
        Comments = row["Comments"].ToString();
        Date     = Convert.ToDateTime(row["Date"]);
        if (row["Approver"] != DBNull.Value)
        {
            Approver = Convert.ToInt32(row["Approver"]);
        }

        ApproverName = row["ApproverName"].ToString();

        Detail = new ReportDetail(row);
    }
Пример #19
0
 protected void btnBindResTask_Click(object sender, System.EventArgs e)
 {
     try
     {
         string value = this.hfldTaskId.Value;
         System.Collections.Generic.List <string> listFromJson = JsonHelper.GetListFromJson(value);
         string    proVerId = base.Request["id"];
         DataTable tasks    = ReportDetail.GetTasks(proVerId, listFromJson);
         if (this.ViewState["PTasks"] != null)
         {
             DataTable dataTable = this.ViewState["PTasks"] as DataTable;
             System.Collections.Generic.List <DataRow> list = new System.Collections.Generic.List <DataRow>();
             foreach (DataRow dataRow in tasks.Rows)
             {
                 int num = dataTable.Select("TaskUID='" + dataRow["TaskUID"] + "'").Count <DataRow>();
                 if (num > 0)
                 {
                     list.Add(dataRow);
                 }
             }
             foreach (DataRow current in list)
             {
                 tasks.Rows.Remove(current);
             }
             dataTable.Merge(tasks);
             this.ViewState["PTasks"] = dataTable;
         }
         else
         {
             this.ViewState["PTasks"] = tasks;
         }
         DataTable dtSource = this.ViewState["PTasks"] as DataTable;
         this.Bind(dtSource);
     }
     catch
     {
     }
 }
Пример #20
0
        private void StartTranscribingWorklistItem()
        {
            ClaimWorklistItem(this.WorklistItem);

            Platform.GetService <ITranscriptionWorkflowService>(service =>
            {
                var enablementResponse = service.GetOperationEnablement(new GetOperationEnablementRequest(this.WorklistItem));
                _canComplete           = enablementResponse.OperationEnablementDictionary["CompleteTranscription"];
                _canReject             = enablementResponse.OperationEnablementDictionary["RejectTranscription"];
                _canSubmitForReview    = enablementResponse.OperationEnablementDictionary["SubmitTranscriptionForReview"];
                _canSaveReport         = enablementResponse.OperationEnablementDictionary["SaveTranscription"];

                var loadTranscriptionForEditResponse = service.LoadTranscriptionForEdit(new LoadTranscriptionForEditRequest(this.WorklistItem.ProcedureStepRef));
                _report = loadTranscriptionForEditResponse.Report;
                _activeReportPartIndex = loadTranscriptionForEditResponse.ReportPartIndex;
                _orderDetail           = loadTranscriptionForEditResponse.Order;

                var activePart = _report.GetPart(_activeReportPartIndex);
                _reportPartExtendedProperties = activePart == null ? null : activePart.ExtendedProperties;

                if (activePart != null && activePart.TranscriptionSupervisor != null)
                {
                    // active part already has a supervisor assigned
                    _supervisor = activePart.TranscriptionSupervisor;
                }
                else if (
                    Thread.CurrentPrincipal.IsInRole(
                        ClearCanvas.Ris.Application.Common.AuthorityTokens.Workflow.Transcription.SubmitForReview))
                {
                    // active part does not have a supervisor assigned
                    // if this user has a default supervisor, retreive it, otherwise leave supervisor as null
                    if (!String.IsNullOrEmpty(TranscriptionSettings.Default.SupervisorID))
                    {
                        _supervisor = GetStaffByID(TranscriptionSettings.Default.SupervisorID);
                    }
                }
            });
        }
Пример #21
0
 public GameRecord()
 {
     InitializeComponent();
     rbtLists.IsChecked = true;
     datePickerStart.SelectedDate = DateTime.Now;
     datePickerEnd.SelectedDate = DateTime.Now;
     BindedLst = new List<long>();
     RPageSum = new StatReport();
     RPageSum.UserID = "本页合计";
     RTotalSum = new StatReport();
     RTotalSum.UserID = "总合计";
     DPageSum = new ReportDetail();
     DPageSum.RecordID = "本页合计";
     DPageSum.IsWin = -1;
     DPageSum.Direction = -1;
     DPageSum.ResultStatus = -1;
     DTotalSum = new ReportDetail();
     DTotalSum.RecordID = "总合计";
     DTotalSum.IsWin = -1;
     DTotalSum.Direction = -1;
     DTotalSum.ResultStatus = -1;
     srv_GameRecord = WcfProxy.GetProxy;
     srv_GameRecord.GetStatReportCompleted += new EventHandler<GetStatReportCompletedEventArgs>(srv_GameRecord_GetStatReportCompleted);
     srv_GameRecord.GetReportDetailCompleted += new EventHandler<GetReportDetailCompletedEventArgs>(srv_GameRecord_GetReportDetailCompleted);
     TextBlock txtb = new TextBlock()
     {
         Text = "本级",
         Style = Resources["TextBlockStyle1"] as Style,
         Cursor = Cursors.Hand
     };
     txtb.Tag = user.ID;
     BindedLst.Add(user.ID);
     txtb.MouseLeftButtonDown += new MouseButtonEventHandler(txtb_MouseLeftButtonDown);
     NavMenu.Children.Add(txtb);
     BindReportDetailList(user.UserId);
 }
Пример #22
0
 public IResult Update(ReportDetail reportDetail)
 {
     _reportDetailDal.Update(reportDetail);
     return(new Result(true, Messages.Updated));
 }
Пример #23
0
 public GetReportDetailResponse(ReportDetail report)
 {
     this.Report = report;
 }
Пример #24
0
        public ActionResult ViewReport(Parameter parameter)
        {
            ReportDetail report = new ReportDetail();

            report.Parameter = parameter;
            DateTime fromD, toD;

            if (!DateTime.TryParseExact(parameter.FromDate, "d/M/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out fromD))
            {
                fromD = DateTime.MinValue;
            }
            if (!DateTime.TryParseExact(parameter.ToDate, "d/M/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out toD))
            {
                toD = DateTime.MaxValue;
            }
            else
            {
                toD = toD.AddDays(1);
            }
            var ios = from io in db.InOuts
                      where io.Status == 1 && fromD <= io.PayDate && io.PayDate < toD
                      group io by new { io.PayDate, io.Room.RoomName, io.RoomId } into g
            orderby g.Key ascending
                select new {
                Day               = g.Key.PayDate,
                RoomId            = g.Key.RoomId,
                RoomName          = g.Key.RoomName,
                Count             = g.Count(),
                RoomServiceAmount = g.Sum(o => o.RoomServiceAmount),
                TotalAmount       = g.Sum(o => o.TotalAmount)
            };
            List <Detail2> details = new List <Detail2>();

            foreach (var inout in ios)
            {
                Detail2 d = new Detail2();
                d.Day                 = inout.Day.ToString("dd/MM/yyyy");
                d.RoomName            = inout.RoomName;
                d.Count               = inout.Count;
                d.RoomServiceAmount   = inout.RoomServiceAmount;
                d.TotalAmount         = inout.TotalAmount;
                d.OtherServiceDetails = new List <OtherServiceDetail>();
                var otherServices = from ioo in db.InOut_OtherServices
                                    where ioo.InOut.Status == 1 && ioo.InOut.PayDate == inout.Day && ioo.InOut.RoomId == inout.RoomId
                                    group ioo by new { ioo.OtherService.ServiceName } into g
                orderby g.Key ascending
                    select new
                {
                    OtherServiceName   = g.Key.ServiceName,
                    Quantity           = g.Sum(o => o.Quantity),
                    OtherServiceAmount = g.Sum(o => o.Quantity * o.OtherService.Price),
                };
                foreach (var os in otherServices)
                {
                    d.OtherServiceDetails.Add(new OtherServiceDetail()
                    {
                        OtherServiceName   = os.OtherServiceName,
                        Quantity           = os.Quantity,
                        OtherServiceAmount = os.OtherServiceAmount
                    });
                }
                details.Add(d);
            }
            report.Details = details.ToArray();
            return(View("Index", report));
        }
Пример #25
0
        private int DetailInfo(string bgdh, out ArrayList list, out string msg)
        {
            int result = -1;

            list = new ArrayList();
            msg  = "";
            WebserviceOpe _webservice;

            _webservice = new WebserviceOpe();
            try
            {
                Object[] obj = new Object[1];
                obj[0] = bgdh;

                string _webResult = _webservice.WebserviceRetInfo(WebConfigParameter.WebserviceUrl,
                                                                  WebConfigParameter.WebserviceClassName, "getreportinfo", obj);
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(_webResult);

                XmlNode data = doc.SelectSingleNode("data");
                if (null == data)
                {
                    msg = "调用后台WEBSERVICE出错";
                    return(1);
                }

                XmlNode stateNode = data.SelectSingleNode("state");
                if (null == stateNode)
                {
                    msg = "调用后台WEBSERVICE出错";
                    return(1);
                }

                int stateResult = Convert.ToInt32(stateNode.InnerText);
                if (stateResult != 1)
                {
                    msg = "调用后台WEBSERVICE出错";
                    return(1);
                }

                XmlNode resultNode = data.SelectSingleNode("result");
                if (null == resultNode)
                {
                    msg = "调用后台WEBSERVICE出错";
                    return(1);
                }

                XmlNodeList itemNodes = resultNode.SelectNodes("item");
                if (null == itemNodes)
                {
                    msg = "调用后台WEBSERVICE出错";
                    return(1);
                }

                foreach (XmlNode itemNode in itemNodes)
                {
                    ReportDetail reportInfo = new ReportDetail();
                    foreach (XmlNode childNode in itemNode)
                    {
                        string name = childNode.Name;

                        switch (name)
                        {
                        case "xmmc":
                            reportInfo.mc = childNode.InnerText;
                            break;

                        case "ckfw":
                            reportInfo.ckjg = childNode.InnerText;
                            break;

                        case "result":
                            reportInfo.jg = childNode.InnerText;
                            break;

                        case "xmdw":
                            reportInfo.dw = childNode.InnerText;
                            break;

                        case "hint":
                            reportInfo.ts = childNode.InnerText;
                            break;
                        }
                    }
                    list.Add(reportInfo);
                }

                result = 0;
            }
            catch (Exception ex)
            {
                msg = GetExceptionInfo(ex);
            }


            return(result);
        }
 public LoadTranscriptionForEditResponse(ReportDetail report, int reportPartIndex, OrderDetail order)
 {
     Report          = report;
     ReportPartIndex = reportPartIndex;
     Order           = order;
 }
Пример #27
0
 public GetReportDetailResponse(ReportDetail report)
 {
     this.Report = report;
 }
		public LoadTranscriptionForEditResponse(ReportDetail report, int reportPartIndex, OrderDetail order)
		{
			Report = report;
			ReportPartIndex = reportPartIndex;
			Order = order;
		}
Пример #29
0
        private static void ExportExcelFileData(SupermarketsEntities1 mssqlSupermarketContext, DateTime currentDate, string currentFile, Dictionary <string, Supermarket> supermarketsInTheDB)
        {
            string          connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + currentFile + ";Extended Properties=Excel 12.0;";
            OleDbConnection excelConnection  = new OleDbConnection(connectionString);

            excelConnection.Open();
            using (excelConnection)
            {
                OleDbCommand getExcelSheetData = new OleDbCommand(
                    "SELECT * " +
                    "FROM [Sales$]", excelConnection);

                OleDbDataReader reader = getExcelSheetData.ExecuteReader();
                using (reader)
                {
                    bool   headerRow = true;
                    Report newReport = null;
                    while (reader.Read())
                    {
                        var firstColumnValue = reader[0];
                        if (headerRow)
                        {
                            string supermarketNameFull = (string)firstColumnValue;
                            int    indexFirstQuote     = supermarketNameFull.IndexOf('“');
                            int    indexSecondQuote    = supermarketNameFull.IndexOf('”');
                            string supermarketName     = supermarketNameFull.Substring(indexFirstQuote + 1, indexSecondQuote - indexFirstQuote - 1);

                            Supermarket currentSupermarket;

                            if (supermarketsInTheDB.ContainsKey(supermarketName))
                            {
                                currentSupermarket = supermarketsInTheDB[supermarketName];
                            }
                            else
                            {
                                currentSupermarket = new Supermarket();
                                currentSupermarket.SupermarketName = supermarketName;
                                mssqlSupermarketContext.Supermarkets.Add(currentSupermarket);

                                supermarketsInTheDB[supermarketName] = currentSupermarket;
                            }


                            newReport            = new Report();
                            newReport.ReportDate = currentDate;

                            currentSupermarket.Reports.Add(newReport);

                            headerRow = false;
                        }
                        ;

                        int productId;
                        if (int.TryParse((string)firstColumnValue, out productId))
                        {
                            ReportDetail newReportDetail = new ReportDetail();

                            string secondColumnValue = reader[1].ToString();
                            newReportDetail.Quantity = int.Parse(secondColumnValue);
                            string thirdColumnValue = reader[2].ToString();
                            newReportDetail.UnitPrice = decimal.Parse(thirdColumnValue);
                            newReport.ReportDetails.Add(newReportDetail);

                            MSSQLEntityModel.Product currentProduct = mssqlSupermarketContext.Products.Find(productId);
                            currentProduct.ReportDetails.Add(newReportDetail);
                        }
                    }
                }
            }
        }
Пример #30
0
 public void srv_GameRecord_GetReportDetailCompleted(object sender, GetReportDetailCompletedEventArgs e)
 {
     gridLoading.Visibility = Visibility.Collapsed;
     currentPos = 0;
     obReportDetail = e.Result.ToList();
     //obReportDetail.Add(DPageSum);
     //obReportDetail.Add(DTotalSum);
     if (e.Result.Count != 0)
     {
         DTotalSum = new ReportDetail();
         DTotalSum.RecordID = "总合计";
         DTotalSum.IsWin = -1;
         DTotalSum.Direction = -1;
         DTotalSum.ResultStatus = -1;
         DTotalSum.BetMoney = obReportDetail.Sum(p => p.BetMoney);
         DTotalSum.WinMoney = obReportDetail.Sum(p => p.WinMoney);
         if (e.Result.Count < 18)
         {
             obReportDetail = e.Result.ToList();
             DPageSum = new ReportDetail();
             DPageSum.RecordID = "本页合计";
             DPageSum.IsWin = -1;
             DPageSum.Direction = -1;
             DPageSum.ResultStatus = -1;
             DPageSum.BetMoney = obReportDetail.Take(18).Sum(p => p.BetMoney);
             DPageSum.WinMoney = obReportDetail.Take(18).Sum(p => p.WinMoney);
             obReportDetail.Add(DPageSum);
             obReportDetail.Add(DTotalSum);
             currentPos = 0;
             PagedCollectionView pageView = new PagedCollectionView(obReportDetail);
             pageView.PageSize = 20;
             dpRecord.PageSize = 20;
             dpRecord.Source = pageView;
             dgRecord.ItemsSource = pageView;
         }
         else
         {
             int page = int.Parse(Math.Ceiling(double.Parse(e.Result.Count.ToString()) / 18).ToString());
             for (int i = 0; i < page; i++)
             {
                 int stayNum = obReportDetail.Count - (i * 20);
                 if (stayNum > 18)
                 {
                     DPageSum = new ReportDetail();
                     DPageSum.RecordID = "本页合计";
                     DPageSum.IsWin = -1;
                     DPageSum.Direction = -1;
                     DPageSum.ResultStatus = -1;
                     //DPageSum.BetMoney = obReportDetail.Skip(i * 20).Take(18).Sum(p => p.BetMoney);
                     //DPageSum.WinMoney = obReportDetail.Skip(i * 20).Take(18).Sum(p => p.WinMoney);
                     DPageSum.BetMoney = obReportDetail.GetRange(i * 20, 18).Sum(p => p.BetMoney);
                     DPageSum.WinMoney = obReportDetail.GetRange(i * 20, 18).Sum(p => p.WinMoney);
                     obReportDetail.Insert(i * 20 + 18, DPageSum);
                     obReportDetail.Insert(i * 20 + 19, DTotalSum);
                 }
                 else
                 {
                     DPageSum = new ReportDetail();
                     DPageSum.RecordID = "本页合计";
                     DPageSum.IsWin = -1;
                     DPageSum.Direction = -1;
                     DPageSum.ResultStatus = -1;
                     //DPageSum.BetMoney = obReportDetail.Skip(i * 20).Take(stayNum).Sum(p => p.BetMoney);
                     //DPageSum.WinMoney = obReportDetail.Skip(i * 20).Take(stayNum).Sum(p => p.WinMoney);
                     DPageSum.BetMoney = obReportDetail.GetRange(i * 20, stayNum).Sum(p => p.BetMoney);
                     DPageSum.WinMoney = obReportDetail.GetRange(i * 20, stayNum).Sum(p => p.WinMoney);
                     obReportDetail.Insert(i * 20 + stayNum, DPageSum);
                     obReportDetail.Insert(i * 20 + stayNum + 1, DTotalSum);
                 }
             }
             currentPos = 0;
             PagedCollectionView pageView = new PagedCollectionView(obReportDetail);
             pageView.PageSize = 20;
             dpRecord.PageSize = 20;
             dpRecord.Source = pageView;
             dgRecord.ItemsSource = pageView;
         }
     }
     else
     {
         PagedCollectionView pageView = new PagedCollectionView(obReportDetail);
         pageView.PageSize = 20;
         dpRecord.PageSize = 20;
         dpRecord.Source = pageView;
         dgRecord.ItemsSource = pageView;
     }
     BindStatReportList(user.ID);
 }
Пример #31
0
        /// <summary>
        /// 根据报告单号查询报告详细
        /// </summary>
        /// <param name="bgdh">报告单号</param>       
        /// <param name="rds">报告信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_QueryReportDetail(string bgdh, out ICollection<ReportDetail> rds, out string msg)
        {
            string _oraConStr = WebConfigParameter.ConnectionHisString;

            if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSZXYJHYY ||
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDSRMYY ||
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDERMYY ||
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXFYBJYY ||
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSRAZYY ||
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTXRMYY)
            {
                _oraConStr = WebConfigParameter.ConnectionLisString;
            }

            OracleConnection connection = new OracleConnection(_oraConStr);
            OracleDataReader dr = null;


            try
            {
                bool _flag = false;

                string sql = _builder.GetReportDetailXM(bgdh, out _flag, out msg);

                if (!_flag)
                {
                    rds = new List<ReportDetail>();
                    return 10;
                }

                dr = DbHelperOra.ExecuteReader(sql, connection);
                if (dr.HasRows)
                {
                    rds = new List<ReportDetail>();
                    while (dr.Read())
                    {
                        ReportDetail rd = new ReportDetail();
                        rd.mc = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        rd.dw = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        rd.ckjg = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        rd.ts = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                        rd.jg = !dr.IsDBNull(4) ? dr.GetString(4) : "";

                        rds.Add(rd);
                    }


                    msg = "找到报告明细";
                    return 0;
                }
                else
                {
                    rds = null;
                    msg = "未找到报告详细内容";
                    return 2;
                }
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg = GetExceptionInfo(ex);
                rds = null;
                return -2;
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
Пример #32
0
        /// <summary>
        /// 根据报告单号查询报告详细
        /// </summary>
        /// <param name="bgdh">报告单号</param>
        /// <param name="rds">报告信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_queryReportJCDetail(string bgdh, out ICollection <ReportDetail> rds, out string msg)
        {
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                bool _flag = false;

                string sql = _builder.GetReportJCDetailXM(bgdh, out _flag, out msg);

                if (!_flag)
                {
                    rds = new List <ReportDetail>();
                    return(10);
                }

                dr = DbHelperOra.ExecuteReader(sql, connection);
                if (dr.HasRows)
                {
                    rds = new List <ReportDetail>();
                    while (dr.Read())
                    {
                        ReportDetail rd = new ReportDetail();
                        rd.mc   = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        rd.dw   = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        rd.ckjg = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        rd.ts   = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                        rd.jg   = !dr.IsDBNull(4) ? dr.GetString(4) : "";

                        rds.Add(rd);
                    }


                    msg = "找到报告明细";
                    return(0);
                }
                else
                {
                    rds = null;
                    msg = "未找到报告详细内容";
                    return(2);
                }
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg = GetExceptionInfo(ex);
                rds = null;
                return(-2);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
Пример #33
0
 public IResult Add(ReportDetail reportDetail)
 {
     _reportDetailDal.Add(reportDetail);
     return(new Result(true, Messages.Added));
 }