Ejemplo n.º 1
0
        /// <summary>
        /// 完成总检
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnFinish_Click(object sender, EventArgs e)
        {
            if (gdOrders.SelectedRowIndexArray.Length == 0)//判断是否选中一个体检者
            {
                MessageBoxShow("您未选中记录!", MessageBoxIcon.Information);
                return;
            }
            StringBuilder errOrdernum = new StringBuilder();

            try
            {
                for (int i = 0; i < gdOrders.SelectedRowIndexArray.Length; i++)
                {
                    int    selectIndex = gdOrders.SelectedRowIndexArray[i];
                    string ordernum    = gdOrders.DataKeys[selectIndex][0].ToString();
                    int    status      = int.Parse(gdOrders.DataKeys[selectIndex][1].ToString());

                    if (status != (int)ParamStatus.OrdersStatus.FirstCheck)
                    {
                        MessageBoxShow("状态为初步总检时才可以审核");
                        return;
                    }
                    Hashtable ht = new Hashtable();
                    ht.Add("ordernum", ordernum);
                    ht.Add("oldstatus", (int)ParamStatus.OrdersStatus.FirstCheck);
                    ht.Add("status", (int)ParamStatus.OrdersStatus.FinishCheck);
                    ht.Add("finishbyid", Userinfo.userId);
                    ht.Add("TRANSED", 0);
                    if (ordersService.EditStatusByOldStatus(ht))
                    {
                        //记录日志
                        ordersService.AddOperationLog(ordernum, null, "总检", "完成总检审核成功", "修改留痕", "");
                        //获取报告数据并保存
                        Orderreportdata reportdata = new Orderreportdata()
                        {
                            Ordernum = ordernum, ReportData = commonreport.GetSerializeReportDate(ordernum), Createdate = loginservice.GetServerTime()
                        };
                        reportdataService.AddOrderreportdata(reportdata);
                    }
                    else
                    {
                        errOrdernum.Append(ordernum + ",");
                    }
                }
                MessageBoxShow("所选记录完成总检审核成功!", MessageBoxIcon.Information);
                GvOrdersBinder();
                ClearOrdersTestAndOrderdiagnosisAndOrderNextTest();
            }
            catch (Exception ex)
            {
                MessageBoxShow(string.Format("订单号为:{0}完成总检审核失败,错误信息:{1}", errOrdernum, ex.Message));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// C14/C13自动初步总检+完成总检,不用判断结果是否异常,且不用写结果评价
        /// </summary>
        /// <param name="dr"></param>
        private void autoC14Check(DataRow dr)
        {
            string    ordernum    = dr["ordernum"].ToString();
            string    productname = dr["ordertestlst"].ToString();
            Hashtable htScan      = new Hashtable();

            htScan.Add("isScan", true);
            htScan.Add("EnterByID", userid);
            htScan.Add("EnterBy", username);
            //1、初步总检
            Hashtable ht = new Hashtable();

            ht.Add("ordernum", ordernum);
            ht.Add("oldstatus", (int)ParamStatus.OrdersStatus.WaitCheck);
            ht.Add("status", (int)ParamStatus.OrdersStatus.FirstCheck);
            ht.Add("authorizedbyid", userid);
            if (os.EditStatusByOldStatus(ht))
            {
                //初步总检成功后记录操作日志
                os.AddOperationLog(ordernum, null, "初步总检", "对[" + ordernum + "]执行自动初步总检", "修改留痕", "", htScan);
                //2、完成总检
                Hashtable ht1 = new Hashtable();
                ht1.Add("ordernum", ordernum);
                ht1.Add("oldstatus", (int)ParamStatus.OrdersStatus.FirstCheck);
                ht1.Add("status", (int)ParamStatus.OrdersStatus.FinishCheck);
                ht1.Add("finishbyid", userid);
                ht1.Add("TRANSED", 0);
                if (os.EditStatusByOldStatus(ht1))
                {
                    //完成总检成功后记录操作日志
                    os.AddOperationLog(ordernum, null, "完成总检", "对[" + ordernum + "]执行自动完成总检", "修改留痕", "", htScan);
                    //3、生成报告数据
                    Orderreportdata reportdata = new Orderreportdata()
                    {
                        Ordernum = ordernum, ReportData = commonreport.GetSerializeReportDate(ordernum), Createdate = loginservice.GetServerTime()
                    };
                    reportdataService.AddOrderreportdata(reportdata);
                    //4、如果是现场报告,直接将状态改为报告已打印
                    if (productname.Contains("现场报告"))
                    {
                        Hashtable ht2 = new Hashtable();
                        ht2.Add("ordernum", ordernum);
                        ht2.Add("oldstatus", (int)ParamStatus.OrdersStatus.FinishCheck);
                        ht2.Add("status", (int)ParamStatus.OrdersStatus.FinishPrint);
                        if (os.EditStatusByOldStatus(ht2))
                        {
                            os.AddOperationLog(ordernum, null, "报告单集中打印", "对[" + ordernum + "]【现场报告】执行自动更改报告已打印状态", "修改留痕", "", null);
                        }
                    }
                }
            }
        }