Ejemplo n.º 1
0
        public static void Log(ErrType et)
        {
            switch (et)
            {
            case ErrType.emptylist:
                Console.WriteLine("danh sach trong");
                break;

            case ErrType.notexist:
                Console.WriteLine("khong ton tai");
                break;

            case ErrType.failed:
                Console.WriteLine("that bai");
                break;

            case ErrType.succes:
                Console.WriteLine("thanh cong");
                break;

            case ErrType.existed:
                Console.WriteLine("da ton tai");
                break;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 减少库存
 /// </summary>
 /// <param name="id"></param>
 /// <param name="num"></param>
 /// <returns></returns>
 public Task <int> Reduce(long id, int num)
 {
     if (Monitor.TryEnter(locker, 2000))
     {
         ErrType flag = ErrType.Success;
         int     stock;
         if (dict.TryGetValue(id, out stock))
         {
             //有该商品
             if (num > stock)
             {
                 //超量了
                 flag = ErrType.NotEnough;
             }
             else
             {
                 stock    = stock - num;
                 dict[id] = stock;
             }
         }
         else
         {
             flag = ErrType.NotExist;
         }
         Monitor.Exit(locker);
         return(Task.FromResult((int)flag));
     }
     else
     {
         return(Task.FromResult((int)ErrType.TimeOut));
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 屏幕内容
 /// </summary>
 /// <param name="select">所选屏幕</param>
 /// <param name="screen">屏幕bmp内容</param>
 public ProcResult(Screen.Select select)
 {
     ScreenSelect = select;
     ErrorNum     = ErrType.ErrSuccess;
     StatText     = "正常";
     TextColor    = Color.Green;
 }
Ejemplo n.º 4
0
 public WFException(ErrType errType, string message, Exception error)
     : base(message, error)
 {
     _exception = error;
     _message = message;
     _errType = errType;
 }
Ejemplo n.º 5
0
        private void ShowErrInfo()
        {
            long curStockOrgId;

            if ((this.opResults == null) || (this.opResults.Count < 1))
            {
                this.ShowErrGrid(true);
            }
            else
            {
                int entryCurrentRowIndex = this.Model.GetEntryCurrentRowIndex("FEntityAction");
                curStockOrgId = Convert.ToInt64(this.Model.GetValue("FStockOrgID", entryCurrentRowIndex));
                StockOrgOperateResult opResult = this.opResults.SingleOrDefault <StockOrgOperateResult>(p => p.StockOrgID == curStockOrgId);
                entryCurrentRowIndex = this.Model.GetEntryCurrentRowIndex("FEntityErrType");
                ErrType none = ErrType.None;
                object  obj2 = this.Model.GetValue("FErrorType", entryCurrentRowIndex);
                if ((obj2 != null) && !string.IsNullOrWhiteSpace(obj2.ToString()))
                {
                    Enum.TryParse <ErrType>(obj2.ToString(), out none);
                }
                this.RefreshErrEntity(opResult, none);
                this.RefreshStkBillDraftEntry(opResult, none);
                this.RefreshStkCntBillAuditEntry(opResult, none);
                this.RefreshMinusEntry(opResult, none);
                this.ShowHideErrTabDetail(opResult, none);
                this.ShowErrGrid(true);
            }
        }
Ejemplo n.º 6
0
 private void UpdateErrorReferecedBy(SpreadsheetCell cell, ErrType Check, string root)
 {
     /* This function will update all of the cells that reference the passed cell IFF an error has been detected
     * Cells that contain the error and cells that reference cells containing an error will use this function */
     if (this.refTable.ContainsKey(CellToString(cell))) // Ensures that the current cell has other cells that reference it
     {
         for (int i = 0; i < this.refTable[CellToString(cell)].Count; i++)
         {
             SpreadsheetCell nextCell = StringToCell(this.refTable[CellToString(cell)].ElementAt <string>(i)); // Looks up the next cell that references the current cell
             if (Check == ErrType.SelfRef && CellToString(nextCell) == root)                                   // Stop self-referencing loops
             {
                 break;                                                                                        // Updates all cells that reference it
             }
             else if (Check == ErrType.CircRef && CellToString(nextCell) == root)                              // stops circular-referencing loops
             {
                 break;
             }
             else
             {
                 CheckErr(nextCell, Check, root);
                 UpdateErrorReferecedBy(nextCell, Check, root); // Continues updated all cells that reference THIS cell
             }
         }
     }
 }
Ejemplo n.º 7
0
        public void GetJgjGoodsExecute()
        {
            if (JgjGoodsList != null && JgjGoodsList.Count > 0)
            {
                JgjGoodsList.Clear();
            }
            BzjOrderEntity entity = new BzjOrderEntity();

            entity.Account    = JgjGoodsCondition.Account;                       //客户账号
            entity.OrderNO    = JgjGoodsCondition.OrderNO;                       //单号
            entity.Name       = JgjGoodsCondition.UserName;                      //姓名
            entity.OrderCode  = JgjGoodsCondition.OrderCode;                     //验证码
            entity.CreateDate = JgjGoodsCondition.StartTime.ToString();          //提货开始时间
            entity.EndDate    = JgjGoodsCondition.EndTime.AddDays(1).ToString(); //提货结束时间
            int     pageCount = 0;
            ErrType err       = _bzjService.GetOrderJsjList(_loginID, entity, JgjGoodsCondition.PageIndex,
                                                            JgjGoodsCondition.PageSize, ref pageCount, ref _JgjGoodsList, (int)_accType);

            if (err.Err != ERR.SUCCESS)
            {
                MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                JgjGoodsCondition.PageCount = pageCount;
                JgjGoodsList = _JgjGoodsList;
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 提货
        /// </summary>
        /// <param name="au"></param>
        /// <param name="ag"></param>
        /// <param name="orderCode"></param>
        public bool SubjectTakeGoodsOrder(decimal au, decimal ag, decimal pt, decimal pd, string orderCode)
        {
            string agentID = "";

            if (_accType == ACCOUNT_TYPE.DealerClerk)
            {
                agentID = _ClerkAgentId;
            }
            else if (_accType == ACCOUNT_TYPE.Dealer)
            {
                agentID = _accName;
            }
            else
            {
                agentID = "";
            }
            ErrType err = _bzjService.UpdateOrder(_accName, _loginID, agentID, "", orderCode, BzjOrderEntity.Account, _accName,
                                                  BzjOrderEntity.UserId, au, ag, pt, pd, (int)_accType);

            if (err.Err == ERR.SUCCESS)
            {
                MessageBox.Show("提货成功", "提示信息", MessageBoxButton.OK, MessageBoxImage.Information);
                return(true);
            }
            else
            {
                MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Error);
                return(false);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 获取买跌交割单数据
        /// </summary>
        public void GetDeliveryBackGoodsExecute()
        {
            if (DeliveryBackGoodsList != null && DeliveryBackGoodsList.Count > 0)
            {
                DeliveryBackGoodsList.Clear();
            }
            CxQueryConInfomation query = new CxQueryConInfomation();

            query.UserType     = (int)_accType;
            query.TradeAccount = DeliveryBackGoodsCondition.Account;
            query.LoginID      = _loginID;
            query.StartTime    = DeliveryBackGoodsCondition.StartTime;
            query.EndTime      = DeliveryBackGoodsCondition.EndTime.AddDays(1);
            int     pageCount = 0;
            ErrType err       = _businessService.GetMultiTradeChcekWithPage(query, DeliveryBackGoodsCondition.PageIndex,
                                                                            DeliveryBackGoodsCondition.PageSize, ref pageCount,
                                                                            ref _DeliveryBackGoodsList);

            if (err.Err != ERR.SUCCESS)
            {
                MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                DeliveryBackGoodsCondition.PageCount = pageCount;
                DeliveryBackGoodsList = _DeliveryBackGoodsList;
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 买跌检测[买跌单]
        /// 定单类型为买跌时有效
        /// </summary>
        /// <param name="selData"></param>
        public void RecordRealWeight(MarketOrderData selData)
        {
            RecordRealWeightWindow window = new RecordRealWeightWindow()
            {
                Owner       = Application.Current.MainWindow,
                DataContext = this,
            };

            if (window.ShowDialog() == true)
            {
                if (selData.TotalWeight < window.RealWeight)
                {
                    MessageBox.Show("您输入的重量大于您的库存", "提示信息", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    ErrType err = _businessService.RecordRealWeight(selData.OrderID, window.RealWeight, _loginID, (int)_accType);
                    if (err.Err == ERR.SUCCESS)
                    {
                        selData.AllowStore = true;
                        MessageBox.Show("您可以入库了", "提示信息", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                    else
                    {
                        MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
            }
        }
Ejemplo n.º 11
0
        public void GetDeliveryGoodsExecute()
        {
            if (DeliveryGoodsList != null && DeliveryGoodsList.Count > 0)
            {
                DeliveryGoodsList.Clear();
            }
            BzjDeliverEntity entity = new BzjDeliverEntity();

            entity.Account    = DeliveryGoodsCondition.Account;                       //客户账号
            entity.DeliverNo  = DeliveryGoodsCondition.OrderNO;                       //单号
            entity.CreateDate = DeliveryGoodsCondition.StartTime.ToString();          //提货开始时间
            entity.EndDate    = DeliveryGoodsCondition.EndTime.AddDays(1).ToString(); //提货结束时间
            int     pageCount = 0;
            ErrType err       = _bzjService.GetDeliverOrderList(_loginID, entity, DeliveryGoodsCondition.UserName,
                                                                DeliveryGoodsCondition.PageIndex,
                                                                DeliveryGoodsCondition.PageSize, ref pageCount,
                                                                ref _DeliveryGoodsList, (int)_accType);

            if (err.Err != ERR.SUCCESS)
            {
                MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                DeliveryGoodsCondition.PageCount = pageCount;
                DeliveryGoodsList = _DeliveryGoodsList;
            }
        }
        private void BackgroundWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            try {
                LoginInformation loginInfo = ( LoginInformation )e.Argument;

                if (_worker.CancellationPending)
                {
                    e.Cancel = true;
                    return;
                }

                if (_vm != null)
                {
                    ErrType err = _vm.Login(loginInfo.AccountName, loginInfo.Password, loginInfo.AccountType);

                    if (_worker.CancellationPending)
                    {
                        e.Cancel = true;
                        return;
                    }
                    e.Result = err;
                }
                CheckUpdateProgram();
            }
            catch (Exception ex) {
                e.Result = new ErrType(ERR.EXEPTION, ErrorText.ServiceError);
            }
        }
Ejemplo n.º 13
0
 public ExecResult(int code, string msg, ErrType errType = ErrType.Normal, object data = null)
 {
     this.code    = code;
     this.msg     = msg;
     this.data    = data;
     this.errType = errType;
 }
Ejemplo n.º 14
0
        public static void Log(ErrType et)
        {
            switch (et)
            {
            case ErrType.EmptyStudent:
                Console.WriteLine("Khong co hoc sinh");
                break;

            case ErrType.Succes:
                Console.WriteLine("thanh cong");
                break;

            case ErrType.Failed:
                Console.WriteLine("that bai");
                break;

            case ErrType.NotExist:
                Console.WriteLine("Khong ton tai");
                break;

            case ErrType.overlimit:
                Console.WriteLine("qua gioi han");
                break;
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 创建店员
        /// </summary>
        public void CreateClerkExecute()
        {
            ClerkAccountInfo         = new BzjClerk();
            ClerkAccountInfo.AgentId = _accName;
            ClerkAuthInfo            = new DealerAuthority();
            ClerkAccountWindow window = new ClerkAccountWindow()
            {
                AccNameVisibility = Visibility.Visible,
                Owner             = Application.Current.MainWindow,
                DataContext       = this
            };

            if (window.ShowDialog() == true)
            {
                ClerkAccountInfo.ClerkId = _accName + ClerkAccountInfo.ClerkId;//店员账号默认以金商账户名开头
                ErrType err = _businessService.AddClerk(ClerkAccountInfo, ClerkAuthInfo, _loginID, (int)_accType);
                if (err.Err != ERR.SUCCESS)
                {
                    MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    //Todo:移动到添加的行
                    ClerkAccountList.Add(ClerkAccountInfo);
                }
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// OperationException 构造函数
        /// </summary>
        /// <param name="errType">错误类别</param>
        /// <param name="errNo">错误号</param>
        /// <param name="err">系统错误</param>
        public OperationException(ErrType errType, ErrNo errNo, System.Exception err)
        {
            this.errType = errType;
            this.errNo = errNo;
            this.err = err;

            //使用log4net写入到日志文本文档
            CBB.Logger.SystemLog.LogHelper.WriteLog("\r\n错误编码:" + errNo.ToString() + "\r\n错误级别:" + errType.ToString() + "\r\n引发当前异常的方法:" + err.TargetSite.Name + "\r\n导致错误的应用程序或对象的名称:" + err.Source + "\r\n异常信息:" + err.Message);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// OperationException 构造函数
        /// </summary>
        /// <param name="errType">错误类别</param>
        /// <param name="errNo">错误号</param>
        public OperationException(ErrType errType, ErrNo errNo)
        {
            this.errType = errType;
            this.errNo = errNo;
            this.err = null;

            //使用log4net写入到日志文本文档
            CBB.Logger.SystemLog.LogHelper.WriteLog("\r\n错误编码:" + errNo.ToString() + "\r\n错误级别:" + errType.ToString());
        }
Ejemplo n.º 18
0
        private void CommandBinding_Executed_DoQuery(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
        {
            ManagementViewModel vm  = this.DataContext as ManagementViewModel;
            ErrType             err = vm.GetOrderNOInfo(txtOdrerCode.Text.Trim());

            if (err.Err == ERR.SUCCESS)
            {
                isExcuteQueryed = true;
            }
        }
Ejemplo n.º 19
0
 public static void Redirect(ErrType errType,string errMsg)
 {
     Uri reffer = System.Web.HttpContext.Current.Request.UrlReferrer;
     if (reffer != null)
     {
         errMsg += "(" + reffer.AbsoluteUri;
     }
     TourLog.ErrorLog.Error(errMsg);
     System.Web.HttpContext.Current.Response.Redirect(errorPageUrl + "?err=" + (int)errType,true);
 }
Ejemplo n.º 20
0
 /// <summary>
 /// 批量减少库存
 /// </summary>
 /// <param name="list"></param>
 /// <returns></returns>
 public Task <int> Reduce(List <GoodsModel> list)
 {
     if (list == null || list.Count == 0)
     {
         return(Task.FromResult((int)ErrType.ArgsIsNull));
     }
     if (Monitor.TryEnter(locker, 2000))
     {
         ErrType           flag     = ErrType.Success;
         List <GoodsModel> editlist = new List <GoodsModel>();
         //检查数据合法性
         list.ForEach(item =>
         {
             int Stock;
             if (dict.TryGetValue(item.id, out Stock))
             {
                 //有该商品
                 if (item.stock > Stock)
                 {
                     //超量了
                     flag = ErrType.NotEnough;
                 }
                 else
                 {
                     editlist.Add(new GoodsModel()
                     {
                         id    = item.id,
                         stock = Stock - item.stock
                     });
                 }
             }
             else
             {
                 flag = ErrType.NotExist;
             }
         });
         //数据合法再修改
         if (flag == ErrType.Success)
         {
             editlist.ForEach(item =>
             {
                 dict[item.id] = item.stock;
             });
         }
         Monitor.Exit(locker);
         return(Task.FromResult((int)flag));
     }
     else
     {
         return(Task.FromResult((int)ErrType.TimeOut));
     }
 }
Ejemplo n.º 21
0
        /// <summary>
        /// 绑定金生金账户
        /// </summary>
        public void BindingBzjAccountExecute()
        {
            ErrType err = _bzjService.AgentBind(BindingJgjAccountCondition.Account, _accName,
                                                BindingJgjAccountCondition.CardNum, _loginID, (int)_accType);

            if (err.Err != ERR.SUCCESS)
            {
                MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                MessageBox.Show("绑定成功!", "提示信息", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        ///	定单明细
        /// </summary>
        /// <param name="orderCode"></param>
        public ErrType GetOrderNOInfo(string orderCode)
        {
            ErrType err = _bzjService.GetOrderNOInfo(_loginID, orderCode, ref _BzjOrderEntity, (int)_accType);

            if (err.Err == ERR.SUCCESS)
            {
                BzjOrderEntity = _BzjOrderEntity;
            }
            else
            {
                MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            return(err);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 实物入库
        /// </summary>
        /// <param name="client"></param>
        public void EntityAccept(ClientAccount client)
        {
            EntityAcceptWindow window = new EntityAcceptWindow()
            {
                Owner       = Application.Current.MainWindow,
                DataContext = this,
            };

            if (window.ShowDialog() == true)
            {
                string product = "";
                double price   = 0;
                switch (window.ProductName)
                {
                case "黄金":
                    product = "XAU";
                    price   = ProductInfoes.Where(p => p.StockCode.Contains("XAU")).FirstOrDefault().RealTimePrice;
                    break;

                case "白银":
                    product = "XAG";
                    price   = ProductInfoes.Where(p => p.StockCode.Contains("XAG")).FirstOrDefault().RealTimePrice;
                    break;

                case "钯金":
                    product = "XPD";
                    price   = ProductInfoes.Where(p => p.StockCode.Contains("XPD")).FirstOrDefault().RealTimePrice;
                    break;

                case "铂金":
                    product = "XPT";
                    price   = ProductInfoes.Where(p => p.StockCode.Contains("XPT")).FirstOrDefault().RealTimePrice;
                    break;
                }
                string deliverNo = DateTime.Now.ToString("yyMMddhhmmsssffff");

                ErrType err = _bzjService.CreateDeliverAdmin(client.AccInfo.UserID, _accName, client.AccInfo.AccountName, "1",
                                                             product, _loginID, deliverNo, (decimal)window.Total, price, 9, (int)_accType);
                if (err.Err == ERR.SUCCESS)
                {
                    MessageBox.Show("实物入库成功", "提示信息", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 更新买跌单
        /// </summary>
        /// <param name="selectData"></param>
        public void UpdateBuyBackOrder(BzjOrderEntity selectData)
        {
            ErrType err = _bzjService.UpdateBuyBackOrder(_loginID, selectData.OrderNO, _accName, (int)_accType);

            if (err.Err != ERR.SUCCESS)
            {
                MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                MessageBox.Show("更新成功", "提示信息", MessageBoxButton.OK, MessageBoxImage.Information);
                selectData.OperationDate = DateTime.Now.ToShortDateString(); //付款时间
                selectData.ClerkId       = _accName;
                selectData.State         = 2;                                //状态更新为完成
            }
        }
Ejemplo n.º 25
0
 private void ShowHideErrTabDetail(StockOrgOperateResult opResult, ErrType errType)
 {
     this.View.GetBarItem("FMinusEntry", "tbIgnoreMinus").Enabled = false;
     this.View.GetBarItem("FStkCountBillAuditEntry", "tbIgnoreStkBillAudit").Enabled = false;
     this.View.GetBarItem("FStkDraftBillEntry", "tbIgnoreStkBillDraft").Enabled      = false;
     if (errType == ErrType.Minus)
     {
         this.View.GetControl <EntryGrid>("FStkCountBillAuditEntry").Visible = false;
         this.View.GetControl <EntryGrid>("FStkDraftBillEntry").Visible      = false;
         this.View.GetControl <EntryGrid>("FEntityErrInfo").Visible          = false;
         this.View.GetControl <EntryGrid>("FMinusEntry").Visible             = true;
         if (((opResult != null) && (opResult.MinusErrObject != null)) && (Convert.ToInt32(opResult.MinusErrObject["ErrType"]) == 1))
         {
             this.View.GetBarItem("FMinusEntry", "tbIgnoreMinus").Enabled = true;
         }
     }
     else if (errType == ErrType.UnAuditStkCountBill)
     {
         this.View.GetControl <EntryGrid>("FStkCountBillAuditEntry").Visible = true;
         this.View.GetControl <EntryGrid>("FStkDraftBillEntry").Visible      = false;
         this.View.GetControl <EntryGrid>("FEntityErrInfo").Visible          = false;
         this.View.GetControl <EntryGrid>("FMinusEntry").Visible             = false;
         if (((opResult != null) && (opResult.StkCountBillAuditErrInfo != null)) && (opResult.StkCountBillAuditErrInfo.Count > 0))
         {
             this.View.GetBarItem("FStkCountBillAuditEntry", "tbIgnoreStkBillAudit").Enabled = true;
         }
     }
     else if (errType == ErrType.StkDraftBill)
     {
         this.View.GetControl <EntryGrid>("FStkCountBillAuditEntry").Visible = false;
         this.View.GetControl <EntryGrid>("FStkDraftBillEntry").Visible      = true;
         this.View.GetControl <EntryGrid>("FEntityErrInfo").Visible          = false;
         this.View.GetControl <EntryGrid>("FMinusEntry").Visible             = false;
         if (((opResult != null) && (opResult.StkBillDraftErrInfo != null)) && (opResult.StkBillDraftErrInfo.Count > 0))
         {
             this.View.GetBarItem("FStkDraftBillEntry", "tbIgnoreStkBillDraft").Enabled = true;
         }
     }
     else
     {
         this.View.GetControl <EntryGrid>("FStkCountBillAuditEntry").Visible = false;
         this.View.GetControl <EntryGrid>("FStkDraftBillEntry").Visible      = false;
         this.View.GetControl <EntryGrid>("FEntityErrInfo").Visible          = true;
         this.View.GetControl <EntryGrid>("FMinusEntry").Visible             = false;
     }
     this.View.UpdateView("FTabErrDetail");
 }
Ejemplo n.º 26
0
        private void RefreshErrEntity(StockOrgOperateResult opResult, ErrType errType)
        {
            Entity                  entryEntity       = this.View.BusinessInfo.GetEntryEntity("FEntityErrInfo");
            DynamicObjectType       dynamicObjectType = entryEntity.DynamicObjectType;
            DynamicObjectCollection entityDataObject  = this.Model.GetEntityDataObject(entryEntity);

            entityDataObject.Clear();
            if (((errType == ErrType.Minus) || (errType == ErrType.None)) || ((errType == ErrType.UnAuditStkCountBill) || (errType == ErrType.StkDraftBill)))
            {
                this.View.UpdateView("FEntityErrInfo");
            }
            else if (((opResult == null) || (opResult.ErrInfo == null)) || (opResult.ErrInfo.Count < 1))
            {
                this.View.UpdateView("FEntityErrInfo");
            }
            else
            {
                IEnumerable <OperateErrorInfo> enumerable;
                if (errType == ErrType.UnAuditBill)
                {
                    enumerable = from p in opResult.ErrInfo
                                 where p.ErrType == Convert.ToInt32(ErrType.UnAuditBill)
                                 select p;
                }
                else
                {
                    enumerable = from p in opResult.ErrInfo
                                 where p.ErrType < Convert.ToInt32(ErrType.OrgStatusErr)
                                 select p;
                }
                foreach (OperateErrorInfo info in enumerable)
                {
                    DynamicObject item = new DynamicObject(dynamicObjectType)
                    {
                        ["ErrType"]        = info.ErrType,
                        ["ErrObjType"]     = info.ErrObjType,
                        ["ErrObjKeyField"] = info.ErrObjKeyField,
                        ["ErrObjKeyID"]    = info.ErrObjKeyID,
                        ["ErrMsg"]         = info.ErrMsg
                    };
                    entityDataObject.Add(item);
                }
                this.View.UpdateView("FEntityErrInfo");
            }
        }
Ejemplo n.º 27
0
        public bool ClearTable(ErrType pTy)
        {
            if (_table == null)
            {
                return(false);
            }
            int num = (int)pTy;

            for (int i = _table.Rows.Count - 1; i >= 0; i--)
            {
                DataRow row = _table.Rows[i];
                if (row["ErrType"].ToString() == num.ToString())
                {
                    _table.Rows.RemoveAt(i);
                }
            }
            return(true);
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 提货受理明细
        /// </summary>
        public void GetTakeGoodsDetialBzjReportExecute()
        {
            if (TakeGoodsDetailList != null && TakeGoodsDetailList.Count > 0)
            {
                TakeGoodsDetailList.Clear();
            }
            int     pageCount = 0;
            ErrType err       = _bzjService.GetAgentOrderList(_accName, _loginID, TakeGoodsDetialSelectCondition.Account, TakeGoodsDetialSelectCondition.OrderNO,
                                                              TakeGoodsDetialSelectCondition.OrderCode, TakeGoodsDetialSelectCondition.UserName, TakeGoodsDetialSelectCondition.StartTime.ToString(),
                                                              TakeGoodsDetialSelectCondition.EndTime.AddDays(1).ToString(), TakeGoodsDetialSelectCondition.PageIndex,
                                                              TakeGoodsDetialSelectCondition.PageSize, ref pageCount, ref _TakeGoodsDetailList, (int)_accType);

            if (err.Err != ERR.SUCCESS)
            {
                MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            TakeGoodsDetialSelectCondition.PageCount = pageCount;
            TakeGoodsDetailList = _TakeGoodsDetailList;
        }
Ejemplo n.º 29
0
 public bool DeleteErrEntity(string pFeatureId, ErrType pTy)
 {
     if (_table == null)
     {
         return(false);
     }
     for (int i = _table.Rows.Count - 1; i >= 0; i--)
     {
         DataRow row = _table.Rows[i];
         if (row["FeatureID"].ToString() == pFeatureId)
         {
             int num2 = (int)pTy;
             if (row["ErrType"].ToString() == num2.ToString())
             {
                 _table.Rows.RemoveAt(i);
             }
         }
     }
     return(true);
 }
Ejemplo n.º 30
0
        private void RefreshMinusEntry(StockOrgOperateResult opResult, ErrType errType)
        {
            Entity                  entryEntity       = this.View.BusinessInfo.GetEntryEntity("FMinusEntry");
            DynamicObjectType       dynamicObjectType = entryEntity.DynamicObjectType;
            DynamicObjectCollection entityDataObject  = this.Model.GetEntityDataObject(entryEntity);

            entityDataObject.Clear();
            if (((opResult != null) && (opResult.MinusErrObject != null)) && (((DynamicObjectCollection)opResult.MinusErrObject["Entry"]).Count > 0))
            {
                foreach (DynamicObject obj2 in (DynamicObjectCollection)opResult.MinusErrObject["Entry"])
                {
                    DynamicObject item = new DynamicObject(dynamicObjectType)
                    {
                        ["ErrMessage"]      = obj2["ErrMessage"],
                        ["MaterialNumber"]  = obj2["MaterialNumber"],
                        ["MaterialName"]    = obj2["MaterialName"],
                        ["Specification"]   = obj2["Specification"],
                        ["StockName"]       = obj2["StockName"],
                        ["StockLocName"]    = obj2["StockLocName"],
                        ["UnitName"]        = obj2["UnitName"],
                        ["Qty"]             = obj2["Qty"],
                        ["SecUnitName"]     = obj2["SecUnitName"],
                        ["SecQty"]          = obj2["SecQty"],
                        ["LotText"]         = obj2["LotText"],
                        ["AuxPropName"]     = obj2["AuxPropName"],
                        ["BOMNumber"]       = obj2["BOMNumber"],
                        ["MtoNo"]           = obj2["MtoNo"],
                        ["ProjectNo"]       = obj2["ProjectNo"],
                        ["ProduceDate"]     = obj2["ProduceDate"],
                        ["ExpiryDate"]      = obj2["ExpiryDate"],
                        ["StockStatusName"] = obj2["StockStatusName"],
                        ["OwnerTypeName"]   = obj2["OwnerTypeName"],
                        ["OwnerName"]       = obj2["OwnerName"],
                        ["KeeperTypeName"]  = obj2["KeeperTypeName"],
                        ["KeeperName"]      = obj2["KeeperName"]
                    };
                    entityDataObject.Add(item);
                }
            }
            this.View.UpdateView("FMinusEntry");
        }
Ejemplo n.º 31
0
        /// <summary>
        /// 显示店员信息
        /// </summary>
        public void ShowClerkAccountInfoExecute()
        {
            //获取权限
            ErrType errClerk = _businessService.GetClerkAuth(ClerkAccountInfo.ClerkId, _loginID, (int)_accType,
                                                             ref _ClerkAuthInfo);

            if (errClerk.Err != ERR.SUCCESS)
            {
                MessageBox.Show(errClerk.ErrMsg, errClerk.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            else
            {
                ClerkAuthInfo = _ClerkAuthInfo;
            }
            //ClerkAuthInfo.IsCanSelectedAllTiHuoShouLiSub = false;
            //ClerkAuthInfo.IsCanSelcetedAllOperating = false;
            //ClerkAuthInfo.IsCanSelcetedAllTrade = false;
            ClerkAccountWindow window = new ClerkAccountWindow()
            {
                Owner       = Application.Current.MainWindow,
                DataContext = this
            };

            if (window.ShowDialog() == true)
            {
                ErrType err = _businessService.ModifyClerk(ClerkAccountInfo, _loginID, (int)_accType);
                if (err.Err != ERR.SUCCESS)
                {
                    MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                ErrType errInfo = _businessService.ModifyClerkAuth(ClerkAuthInfo, ClerkAccountInfo.ClerkId, _loginID,
                                                                   (int)_accType);
                if (errInfo.Err != ERR.SUCCESS)
                {
                    MessageBox.Show(errInfo.ErrMsg, errInfo.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
            }
        }
Ejemplo n.º 32
0
 public void AddErr(List <ErrorEntity> pErrEntity, ErrType pTy, string idname)
 {
     try
     {
         if (_table != null)
         {
             if ((pErrEntity == null) || (pErrEntity.Count < 1))
             {
                 this.ClearTable(idname);
             }
             else if (this.ClearTable(idname))
             {
                 string str = ((int)pErrEntity[0].ErrType).ToString();
                 foreach (ErrorEntity entity in pErrEntity)
                 {
                     ESRI.ArcGIS.Geometry.IGeometry geo = entity.ErrGeo as ESRI.ArcGIS.Geometry.IGeometry;
                     DataRow row = _table.NewRow();
                     row["ID"]        = entity.idname;
                     row["FeatureID"] = entity.FeatureID;
                     row["ErrDes"]    = entity.ErrMsg;
                     row["ErrPos"]    = entity.ErrPos;
                     row["ErrType"]   = str;
                     if (pTy == ErrType.SelfIntersect)
                     {
                         row["Geometry"] = geo.SpatialReference;
                     }
                     else
                     {
                         row["Geometry"] = geo;
                     }
                     _table.Rows.Add(row);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog(typeof(ErrorTable), ex);
         Console.WriteLine("MyException Throw:" + ex.Message);
     }
 }
Ejemplo n.º 33
0
 public void AddMultiOverlapErr(IFeatureClass pFClass)
 {
     if (_table != null)
     {
         ErrType multiOverlap = ErrType.MultiOverlap;
         if (pFClass == null)
         {
             this.ClearTable(multiOverlap);
         }
         else if (this.ClearTable(multiOverlap))
         {
             string   str     = ((int)multiOverlap).ToString();
             IFeature feature = null;
             int      index   = -1;
             for (int i = 0; i < pFClass.Fields.FieldCount; i++)
             {
                 if (pFClass.Fields.get_Field(i).Name.Contains("ID_"))
                 {
                     index = i;
                     break;
                 }
             }
             if (index >= 0)
             {
                 int            num3 = 0;
                 IFeatureCursor o    = pFClass.Search(null, false);
                 while ((feature = o.NextFeature()) != null)
                 {
                     num3++;
                     DataRow row = _table.NewRow();
                     row["FeatureID"] = feature.get_Value(index).ToString();
                     row["ErrDes"]    = "重叠";
                     row["ErrType"]   = str;
                     row["Geometry"]  = feature.ShapeCopy;
                     _table.Rows.Add(row);
                 }
                 Marshal.ReleaseComObject(o);
             }
         }
     }
 }
Ejemplo n.º 34
0
        public static void Log(ErrType et)
        {
            switch (et)
            {
            case ErrType.Succes:
                Console.WriteLine("thanh cong");
                break;

            case ErrType.Failed:
                Console.WriteLine("that bai");
                break;

            case ErrType.NotExist:
                Console.WriteLine("khong ton tai");
                break;

            case ErrType.Empty:
                Console.WriteLine("danh sach trong");
                break;
            }
        }
Ejemplo n.º 35
0
 public static void Redirect(ErrType errType)
 {
     Redirect(errType, string.Empty);
 }
Ejemplo n.º 36
0
 public WFException(ErrType errType, string message)
     : base(message)
 {
     _message = message;
     _errType = errType;
 }
Ejemplo n.º 37
0
 // Private methods
 private static void ToLog(ErrType logType, string data)
 {
     try
     {
         using (FileStream fileStream = new FileStream(
                 Path.ChangeExtension(Application.ExecutablePath, ".log"),
                 FileMode.Append,
                 FileAccess.Write,
                 FileShare.None))
         {
             using (StreamWriter streamWriter = new StreamWriter(fileStream))
             {
                 StringBuilder _strBuild = new StringBuilder("");
                 switch (logType)
                 {
                     case ErrType.Message:
                         _strBuild.Append("\r***MESSAGE***\r" + DateTime.Now.ToString() + "\t");
                         break;
                     case ErrType.Critical:
                         _strBuild.Append("\r***CRITICAL***\r" + DateTime.Now.ToString() + "\t");
                         break;
                     case ErrType.Assert:
                         _strBuild.Append("\r***ASSERT***\r" + DateTime.Now.ToString() + "\t");
                         break;
                     case ErrType.None:
                     default:
                         break;
                 }
                 streamWriter.WriteLine(_strBuild.ToString() + data);
             }
         }
     }
     catch
     {
         return;
     }
 }
Ejemplo n.º 38
0
 private void UpdateErrorReferecedBy(SpreadsheetCell cell, ErrType Check, string root)
 {
     /* This function will update all of the cells that reference the passed cell IFF an error has been detected 
      * Cells that contain the error and cells that reference cells containing an error will use this function */
     if (this.refTable.ContainsKey(CellToString(cell))) // Ensures that the current cell has other cells that reference it
     {
         for (int i = 0; i < this.refTable[CellToString(cell)].Count; i++)
         {
             SpreadsheetCell nextCell = StringToCell(this.refTable[CellToString(cell)].ElementAt<string>(i)); // Looks up the next cell that references the current cell
             if (Check == ErrType.SelfRef && CellToString(nextCell) == root) // Stop self-referencing loops
                 break; // Updates all cells that reference it
             else if (Check == ErrType.CircRef && CellToString(nextCell) == root) // stops circular-referencing loops
                 break;
             else
             {
                 CheckErr(nextCell, Check, root);
                 UpdateErrorReferecedBy(nextCell, Check, root); // Continues updated all cells that reference THIS cell
             }
         }
     }
 }
Ejemplo n.º 39
0
        private void CheckErr(SpreadsheetCell cell, ErrType err, string root)
        {
            /* This function will check the passed error and update the cell accordingly
             * This function will also update cells referencing an error with the location
               where the error is occuring (exluding Circular references)
             * Reinitializes cell delegate */
               
            if (cell.Text == "") // Skips cells that have been reset
                return;
            if (err == ErrType.BadRef) // BAD REFERENCES
            {
                if (CellToString(cell) == root)
                    cell = new Cell(cell, "=<BAD_REF::SRC>"); // Plants the source of the error
                else
                {
                    cell = new Cell(cell, "=<BAD_REF::AT[" + root + "]"); // Updates the cell's value with the location of the error
                }
            }
            else if (err == ErrType.SelfRef) // SELF REFERENCES
            {
                if (CellToString(cell) == root)
                    cell = new Cell(cell, "=<SELF_REF::SRC>");
                else
                {
                    cell = new Cell(cell, "=<SELF_REF::AT[" + root + "]");
                }
            }
            else if (err == ErrType.CircRef) // CIRCULAR REFERENCES
            {
                cell = new Cell(cell, "=<CIRC_REF>");
            }
            else if (err == ErrType.DivZero) // DIVISION BY ZERO
            {
                if (CellToString(cell) == root)
                    cell = new Cell(cell, "=<DIV_ZERO::SRC>");
                else
                {
                    cell = new Cell(cell, "=<DIV_ZERO::AT[" + root + "]");
                }
            }
            else if (err == ErrType.InvExp) // INVALID EXPRESSIONS
            {
                if (CellToString(cell) == root)
                    cell = new Cell(cell, "=<INV_EXP::SRC>");
                else
                {
                    cell = new Cell(cell, "=<INV::EXP::AT[" + root + "]");
                }
            }

            if (err != ErrType.None)
            {
                cellArr[cell.RowIndex, cell.ColumnIndex] = new Cell(cell, cell.Value);
                cellArr[cell.RowIndex, cell.ColumnIndex].PropertyChanged += detect_PropertyChanged; // Reassigns the the detect_property function to the cell's delegate

                CellPropertyChanged(cellArr[cell.RowIndex, cell.ColumnIndex], new PropertyChangedEventArgs("Value")); // fires the event that notifies the GUI of a change
            }
        }
 private void GetOneErrOrAlarmStr(ErrType item, List<MonitorErrData> temp, ref string errStr)
 {
     errStr += GetErrTypeStr(item, temp[0].MonitorResult) + "  " + GetStr("TotalErr", "总数:") + " " + temp.Count;
     if (item != ErrType.DVI && item != ErrType.SenderCard)
     {
         for (int i = 0; i < temp.Count; i++)
         {
             errStr += "\r\n\t\t\t\t";
             errStr += GetErrPositionStr(temp[i].DeviceRegInfo.SenderIndex,
                                     temp[i].DeviceRegInfo.PortIndex,
                                     temp[i].DeviceRegInfo.ConnectIndex,
                                     temp[i].DeviceRegInfo.ScanBoardRows,
                                     temp[i].DeviceRegInfo.ScanBoardCols,
                                     temp[i].DeviceRegInfo.IsComplex);
         }
     }
 }
 //private void AddOneScreen
 private string GetErrTypeStr(ErrType item, MonitorInfoResult monitorResult)
 {
     string msg = "";
     if (item == ErrType.DVI)
     {
         msg = GetStr("DVIFault", "DVI故障");
     }
     if (item == ErrType.SenderCard)
     {
         msg = GetStr("SenderCardFault", "发送卡故障");
     }
     else if(item==ErrType.CabinetDoor)
     {
         msg = GetStr("CabinetDoorAlarm", "箱门开启");
     }
     else if (item == ErrType.Fan)
     {
         msg = GetStr("FanAlarm", "风扇告警");
     }
     else if (item == ErrType.Humidity)
     {
         msg = GetStr("HumidityAlarm", "湿度告警");
     }
     else if (item == ErrType.MonitorCard)
     {
         msg = GetStr("MonitorCardFault", "监控卡故障");
     }
     else if (item == ErrType.Power)
     {
         if(monitorResult == MonitorInfoResult.Fault)
         {
             msg = GetStr("PowerFault", "电源故障");
         }
         else
         {
             msg = GetStr("PowerAlarm", "电源告警");
         }
     }
     else if (item == ErrType.Redundancy)
     {
         msg = GetStr("RedundancyAlarm", "冗余告警");
     }
     else if (item == ErrType.SBStatus)
     {
         msg = GetStr("SBStatusFault", "接收卡故障");
     }
     else if (item == ErrType.Smoke)
     {
         msg = GetStr("SmokeAlarm", "烟雾告警");
     }
     else if (item == ErrType.Soket)
     {
         msg = GetStr("SoketFault", "排线故障");
     }
     else if (item == ErrType.Temperature)
     {
         msg = GetStr("TemperatureAlarm", "温度告警");
     }
     return msg;
 }
        /// <summary>
        /// 更新记录数据
        /// </summary>
        /// <param name="monitor"></param>
        private void AddSystemRunData(ErrType item,int count)
        {
            if (_systemRunRecordData==null)
            {
                _systemRunRecordData = new SystemRunRecordData();
            }

            if (item == ErrType.DVI)
            {
                _systemRunRecordData.SenderErrCount += (uint)count;
            }
            else if (item == ErrType.SenderCard)
            {
                _systemRunRecordData.SenderErrCount += (uint)count;
            }
            else if (item == ErrType.CabinetDoor)
            {
                _systemRunRecordData.CabinetDoorMonitorIndex += (uint)count;
            }
            else if (item == ErrType.Fan)
            {
                _systemRunRecordData.FanAlarmSwitchCount += (uint)count;
            }
            else if (item == ErrType.Humidity)
            {
                _systemRunRecordData.HumidityAlarmCount += (uint)count;
            }
            else if (item == ErrType.MonitorCard)
            {
                _systemRunRecordData.MCStatusErrCount += (uint)count;
            }
            else if (item == ErrType.Power)
            {
                _systemRunRecordData.PowerAlarmSwitchCount += (uint)count;
            }
            else if (item == ErrType.Redundancy)
            {
                _systemRunRecordData.RedundantStateCount += (uint)count;
            }
            else if (item == ErrType.SBStatus)
            {
                _systemRunRecordData.ReceiveCardErroeIndex += (uint)count;
            }
            else if (item == ErrType.Smoke)
            {
                _systemRunRecordData.SmokeMonitorErrorIndex += (uint)count;
            }
            else if (item == ErrType.Soket)
            {
                _systemRunRecordData.CabinetMonitorIndex += (uint)count;
            }
            else if (item == ErrType.Temperature)
            {
                _systemRunRecordData.TemperatureMonitorErrorIndex += (uint)count;
            }
        }