コード例 #1
0
        public EmergentOrder QueryEmergentOrder(decimal id, OrderIdType orderIdType)
        {
            string        sql    = "SELECT Id,[Type],Content,[Time],Account,OrderIdType FROM T_EmergentOrder WHERE Id=@Id AND OrderIdType =@OrderIdType";
            EmergentOrder result = null;

            using (DbOperator dboperator = new DbOperator(Provider, ConnectionString))
            {
                dboperator.AddParameter("Id", id);
                dboperator.AddParameter("OrderIdType", orderIdType);
                using (System.Data.Common.DbDataReader reader = dboperator.ExecuteReader(sql))
                {
                    if (reader.Read())
                    {
                        result                  = new EmergentOrder();
                        result.Id               = reader.GetDecimal(0);
                        result.Type             = (OrderStatus)reader.GetInt32(1);
                        result.Content          = reader.GetString(2);
                        result.Time             = reader.GetDateTime(3);
                        result.Account          = reader.GetString(4);
                        result.OrderIdTypeValue = (OrderIdType)reader.GetByte(5);
                    }
                }
            }
            return(result);
        }
コード例 #2
0
ファイル: Coordination.aspx.cs プロジェクト: 842549829/Pool
        private void BindIdentificationOrderContent(decimal id, OrderStatus status)
        {
            EmergentOrder emergentOrder = ChinaPay.B3B.Service.Order.CoordinationService.GetEmergentOrder(id, status);

            if (emergentOrder != null && !string.IsNullOrEmpty(emergentOrder.Content))
            {
                dropIdentificationOrder.Items[1].Selected = true;
                //txtIdentificationOrder.Text = emergentOrder.Content;
                lblIdentificationTime.Text    = emergentOrder.Time.ToString("yyyy-MM-dd HH:mm:ss");
                lblIdentificationContent.Text = emergentOrder.Content;
                lblIdentificationAccount.Text = emergentOrder.Account;
            }
        }
コード例 #3
0
        public void SvaeEmergentOrder(EmergentOrder emergentOrder)
        {
            string sql = "IF EXISTS(SELECT NULL FROM T_EmergentOrder WHERE Id=@Id AND [Type]=@Type)" +
                         " UPDATE T_EmergentOrder SET Content = @Text, [Time] = @Time, Account=@Account,[OrderIdType] =@OrderIdType WHERE Id=@Id AND [Type]=@Type;ELSE" +
                         " INSERT INTO T_EmergentOrder (Id,[Type],Content,[Time],Account,[OrderIdType]) VALUES(@Id,@Type,@Text,@Time,@Account,@OrderIdType);" +
                         "UPDATE T_Order SET [IsEmergentOrder] = 1 WHERE Id=@OrderId;";

            using (DbOperator dbOperator = new DbOperator(Provider, ConnectionString))
            {
                dbOperator.AddParameter("Id", emergentOrder.Id);
                dbOperator.AddParameter("Type", emergentOrder.Type);
                dbOperator.AddParameter("Text", emergentOrder.Content);
                dbOperator.AddParameter("Time", emergentOrder.Time);
                dbOperator.AddParameter("Account", emergentOrder.Account);
                dbOperator.AddParameter("OrderIdType", emergentOrder.OrderIdTypeValue);
                dbOperator.AddParameter("OrderId", emergentOrder.Id);
                dbOperator.ExecuteNonQuery(sql);
            }
        }
コード例 #4
0
        public EmergentOrder QueryEmergentOrder(decimal id, DataTransferObject.Order.OrderStatus status)
        {
            EmergentOrder emergentOrder = new EmergentOrder();
            string        sql           = "select Id,[Type],Content,[Time],Account from T_EmergentOrder WHERE Id =@Id AND [Type] = @Type";

            using (DbOperator dboperator = new DbOperator(Provider, ConnectionString))
            {
                dboperator.AddParameter("Id", id);
                dboperator.AddParameter("Type", status);
                using (System.Data.Common.DbDataReader reader = dboperator.ExecuteReader(sql))
                {
                    if (reader.Read())
                    {
                        emergentOrder.Id      = reader.GetDecimal(0);
                        emergentOrder.Type    = (DataTransferObject.Order.OrderStatus)reader.GetInt32(1);
                        emergentOrder.Content = reader.GetString(2);
                        emergentOrder.Time    = reader.GetDateTime(3);
                        emergentOrder.Account = reader.GetString(4);
                    }
                }
            }
            return(emergentOrder);
        }
コード例 #5
0
ファイル: CoordinationService.cs プロジェクト: 842549829/Pool
        /// <summary>
        /// 保存紧急订单信息
        /// </summary>
        /// <param name="emergentOrder"></param>
        public static void SvaeEmergentOrder(EmergentOrder emergentOrder, Guid companyId)
        {
            ICoordinationRepository repository = Factory.CreateCoordinationRepository();

            repository.SvaeEmergentOrder(emergentOrder);
            if (emergentOrder.OrderIdTypeValue == OrderIdType.Order)
            {
                try
                {
                    var logOrder = new Log.Domain.OrderLog();
                    logOrder.OrderId     = emergentOrder.Id;
                    logOrder.Account     = emergentOrder.Account;
                    logOrder.Keyword     = "设置紧急";
                    logOrder.Content     = string.Format("订单:{0} 已经被操作员:{1} 设置为紧急", emergentOrder.Id, emergentOrder.Account);
                    logOrder.Company     = companyId;
                    logOrder.Role        = Common.Enums.OperatorRole.Platform;
                    logOrder.Time        = DateTime.Now;
                    logOrder.VisibleRole = OrderRole.Platform;
                    LogService.SaveOrderLog(logOrder);
                }
                catch { }
            }
        }
コード例 #6
0
ファイル: Coordination.aspx.cs プロジェクト: 842549829/Pool
        private void saveCoordination()
        {
            var     businessType = (BusinessType)int.Parse(this.hidBusinessType.Value);
            decimal orderId      = decimal.Parse(this.hidOrderId.Value);

            Service.Order.Domain.Coordination coordination = null;
            bool isManipulative = false;

            if (businessType == BusinessType.出票)
            {
                OrderStatus orderStatus = (OrderStatus)int.Parse(hidOrderStatus.Value);
                if (!string.IsNullOrWhiteSpace(dropIdentificationOrder.SelectedValue))
                {
                    EmergentOrder emergentOrder = emergentOrder = new EmergentOrder();
                    emergentOrder.Id               = orderId;
                    emergentOrder.Content          = dropIdentificationOrder.SelectedValue.Trim();
                    emergentOrder.Time             = DateTime.Now;
                    emergentOrder.Type             = orderStatus;
                    emergentOrder.Account          = CurrentUser.UserName;
                    emergentOrder.OrderIdTypeValue = getOrderIdType();
                    if (!string.IsNullOrEmpty(emergentOrder.Content))
                    {
                        if (emergentOrder.Content.Length > 200)
                        {
                            throw new ChinaPay.Core.CustomException("订单标识内容最多200字");
                        }
                        Service.Order.CoordinationService.SvaeEmergentOrder(emergentOrder, CurrentCompany.CompanyId);
                        lblIdentificationTime.Text    = emergentOrder.Time.ToString("yyyy-MM-dd HH:mm:ss");
                        lblIdentificationContent.Text = emergentOrder.Content;
                        lblIdentificationAccount.Text = emergentOrder.Account;
                        isManipulative = true;
                    }
                }
                if (!string.IsNullOrEmpty(txtCoordinationContent.Text) && !string.IsNullOrEmpty(txtCoordinationResult.Text))
                {
                    if (string.IsNullOrEmpty(ddlContactMode.SelectedValue))
                    {
                        throw new ChinaPay.Core.CustomException("请选择联系方式");
                    }
                    if (txtCoordinationContent.Text.Length > 200)
                    {
                        throw new ChinaPay.Core.CustomException("协调内容最多200字");
                    }
                    if (txtCoordinationResult.Text.Length > 200)
                    {
                        throw new ChinaPay.Core.CustomException("协调结果最多200字");
                    }
                    var contactMode = (ContactMode)int.Parse(this.ddlContactMode.SelectedValue);
                    coordination = new Service.Order.Domain.Coordination(CurrentUser.UserName, this.txtCoordinationContent.Text.Trim(), this.txtCoordinationResult.Text.Trim(), businessType, contactMode);
                    Service.Order.CoordinationService.SaveOrderCoordination(orderId, coordination);
                    Service.OrderProcessService.UpdateRemindStatus(orderId);
                    isManipulative = true;
                }
                if (!isManipulative)
                {
                    throw new ChinaPay.Core.CustomException("由于您未进行任何协调信息变更,本次操作无效");
                }
            }
            else
            {
                var contactMode = (ContactMode)int.Parse(this.ddlContactMode.SelectedValue);
                coordination = new Service.Order.Domain.Coordination(CurrentUser.UserName, this.txtCoordinationContent.Text.Trim(), this.txtCoordinationResult.Text.Trim(), businessType, contactMode);
                var applyformId = decimal.Parse(this.hidApplyformId.Value);
                Service.Order.CoordinationService.SaveApplyformCoordination(orderId, applyformId, coordination);
            }
            //if (coordination != null)
            //{
            //    this.divCoordinationContent.InnerHtml = this.divCoordinationContent.InnerHtml.Insert(this.divCoordinationContent.InnerHtml.Length - 8, drawCoordination(coordination));
            //}
            this.ddlContactMode.ClearSelection();
            this.txtCoordinationContent.Text = string.Empty;
            this.txtCoordinationResult.Text  = string.Empty;
        }