コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] == null)
         {
             MessageBoxShow("编辑对像的ID为空,请返回列表选择要编辑的对象。", MessageBoxIcon.Warning);
             PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
         }
         btnClose.OnClientClick = ActiveWindow.GetConfirmHidePostBackReference();
         Orderexception orderException = new OrderexceptionService().SelectOrderExceptionInfo(Request.QueryString["id"].ToString());
         txtRemark.Text = orderException.Remark;
         txtResult.Text = orderException.Suggestion;
     }
 }
コード例 #2
0
ファイル: FrmException.cs プロジェクト: bigbigwood/daan
        /// <summary>扫描业务主体
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            //设置timer不可用
            timer.Stop();
            try
            {
                Orderexception        exception = new Orderexception();
                OrderexceptionService service   = new OrderexceptionService();

                //调用登陆验证方法(string Login(UserName: string; Password: string; Operator: string))返回SID
                //UserName,Password来源配置文件,Operator为空
                string username = ConfigurationManager.AppSettings["UserName"];
                string password = ConfigurationManager.AppSettings["Password"];
                string Operator = ConfigurationManager.AppSettings["Operator"];
                SendOrdersToLis.CenterServiceSoapClient client = new SendOrdersToLis.CenterServiceSoapClient();

                //按分点查找
                List <Dictlab> labLst = labser.GetDictlabList().Where(c => c.IsActive == '1').ToList <Dictlab>();
                //最后一次更新时间

                foreach (Dictlab dictlab in labLst)
                {
                    string lastDate = service.SelectOrderExceptionLastDate(dictlab.Labcode);
                    if (lastDate == null)
                    {
                        lastDate = DateTime.Now.AddDays(-30).ToString();
                        //lastDate = "2012-12-01";
                    }
                    if (!ht.ContainsKey(dictlab.Labcode))
                    {
                        string strsid = client.Login(dictlab.Labcode, username, password, Operator);
                        if (strsid.Split('|')[0].ToString() == "1")
                        {
                            strsid = strsid.Split('|')[1].ToString();
                            ht.Add(dictlab.Labcode, strsid);
                        }
                        else
                        {
                            strMsg = string.Format(">>>{0}    {1}:登录失败!{2}", DateTime.Now, dictlab.Labname, strsid.Split('|')[1].ToString());

                            AddNodeHandler addNode = new AddNodeHandler(this.TreeViewAdd);
                            this.Invoke(addNode, strMsg);
                            continue;
                        }
                    }
                    // 获取LIS的取消审核与退单信息
                    string strmessage = client.SelectPesExceptionLst(ht[dictlab.Labcode].ToString(), dictlab.Labcode, lastDate);

                    if (strmessage.Contains("MSG0006")) //登陆超时
                    {
                        ht.Remove(dictlab.Labcode);
                        strMsg = string.Format(">>>{0}    {1}:登录超时", DateTime.Now, dictlab.Labname);
                        AddNodeHandler addNode = new AddNodeHandler(this.TreeViewAdd);
                        this.Invoke(addNode, strMsg);
                        continue;
                    }
                    else
                    {
                        string[] strcontent = strmessage.Split('|');
                        if (strcontent[0] == "0")
                        {
                            strMsg = string.Format(">>>{0}    {1}:未查询到数据", DateTime.Now, dictlab.Labname);
                            AddNodeHandler addNode = new AddNodeHandler(this.TreeViewAdd);
                            this.Invoke(addNode, strMsg);
                            continue;
                        }
                        else
                        {
                            DataSet ds = new CommonFuncLibService().CXmlToDataSet(strcontent[1]);
                            if (service.AddOrderExceptional(ds.Tables[0], dictlab.Labcode))
                            {
                                strMsg = string.Format("***{0}    {1}:异常信息获取成功", DateTime.Now, dictlab.Labname);
                                AddNodeHandler addNode = new AddNodeHandler(this.TreeViewAdd);
                                this.Invoke(addNode, strMsg);
                            }
                            else
                            {
                                strMsg = string.Format(">>>{0}    {1}:异常信息获取失败,方法名称:SelectPesExceptionLst", DateTime.Now, dictlab.Labname);
                                AddNodeHandler addNode = new AddNodeHandler(this.TreeViewAdd);
                                this.Invoke(addNode, strMsg);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                strMsg = string.Format(">>>{0}    {1}", DateTime.Now.ToString() + ":  " + ex.Message);
                AddNodeHandler addNode = new AddNodeHandler(this.TreeViewAdd);
                this.Invoke(addNode, strMsg);
            }
            finally
            {
                if (timer != null)
                {
                    timer.Start();
                }
            }
        }