示例#1
0
        /// <summary>
        /// 修改调价单状态
        /// </summary>
        /// <param name="loggingSessionInfo">登录model</param>
        /// <param name="order_id">标识</param>
        /// <param name="billActionType">类型</param>
        /// <returns></returns>
        public bool SetAdjustmentOrderStatus(LoggingSessionInfo loggingSessionInfo, string order_id, BillActionType billActionType)
        {
            string strResult = string.Empty;

            try
            {
                cPos.Admin.Service.BillService bs = new BillService();

                BillOperateStateService state = bs.ApproveBill(loggingSessionInfo, order_id, "", billActionType);
                if (state == BillOperateStateService.ApproveSuccessful)
                {
                    //获取要改变的表单信息
                    BillModel billInfo = new BillService().GetBillById(loggingSessionInfo, order_id);
                    //设置要改变的用户信息
                    AdjustmentOrderInfo itenAdjustmentOrderInfo = new AdjustmentOrderInfo();
                    itenAdjustmentOrderInfo.status         = billInfo.Status;
                    itenAdjustmentOrderInfo.status_desc    = billInfo.BillStatusDescription;
                    itenAdjustmentOrderInfo.order_id       = order_id;
                    itenAdjustmentOrderInfo.modify_user_id = loggingSessionInfo.CurrentUser.User_Id;
                    itenAdjustmentOrderInfo.modify_time    = GetCurrentDateTime(); //获取当前时间
                    //提交
                    MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).Update("AdjustmentOrder.UpdateStatus", itenAdjustmentOrderInfo);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
示例#2
0
        /// <summary>
        /// 提交组织表单单据
        /// </summary>
        /// <param name="loggingSessionInfo"></param>
        /// <param name="unitInfo"></param>
        /// <returns></returns>
        private bool SetUnitInsertBill(LoggingSessionInfo loggingSessionInfo, UnitInfo unitInfo)
        {
            try
            {
                cPos.Model.BillModel      bill = new BillModel();
                cPos.Service.cBillService bs   = new cBillService();

                bill.Id = unitInfo.Id;                                                                        //order_id
                string order_type_id = bs.GetBillKindByCode(loggingSessionInfo, "UNITMANAGER").Id.ToString(); //loggingSession, OrderType
                bill.Code      = bs.GetBillNextCode(loggingSessionInfo, "CreateUnit");                        //BillKindCode
                bill.KindId    = order_type_id;
                bill.UnitId    = loggingSessionInfo.CurrentUserRole.UnitId;
                bill.AddUserId = loggingSessionInfo.CurrentUser.User_Id;

                BillOperateStateService state = bs.InsertBill(loggingSessionInfo, bill);

                if (state == BillOperateStateService.CreateSuccessful)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
示例#3
0
        /// <summary>
        /// 调价单提交到表单
        /// </summary>
        /// <param name="loggingSessionInfo"></param>
        /// <param name="adjustmentOrderInfo"></param>
        /// <returns></returns>
        private bool SetAdjustmentOrderInsertBill(LoggingSessionInfo loggingSessionInfo, AdjustmentOrderInfo adjustmentOrderInfo)
        {
            try
            {
                cPos.Model.BillModel           bill = new BillModel();
                cPos.Admin.Service.BillService bs   = new BillService();

                bill.Id = adjustmentOrderInfo.order_id;                                                           //order_id
                string order_type_id = bs.GetBillKindByCode(loggingSessionInfo, "ADJUSTMENTORDER").Id.ToString(); //loggingSession, OrderType
                bill.Code      = bs.GetBillNextCode(loggingSessionInfo, "CreateAdjustmentPrice");                 //BillKindCode
                bill.KindId    = order_type_id;
                bill.UnitId    = loggingSessionInfo.CurrentUserRole.UnitId;
                bill.AddUserId = loggingSessionInfo.CurrentUser.User_Id;

                BillOperateStateService state = bs.InsertBill(loggingSessionInfo, bill);

                if (state == BillOperateStateService.CreateSuccessful)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);

                throw (ex);
            }
        }
示例#4
0
        /// <summary>
        /// 单位停用启用
        /// </summary>
        /// <param name="unit_id">组织标识</param>
        /// <param name="iStatus">状态</param>
        /// <param name="loggingSession">登录model</param>
        /// <returns></returns>
        public bool SetUnitStatus(string unit_id, string iStatus, LoggingSessionInfo loggingSession)
        {
            try
            {
                cPos.Service.cBillService bs = new cBillService();
                UnitInfo unitInfo            = new UnitInfo();
                unitInfo.Id = unit_id;
                int            iType = 0;
                BillActionType billActionType;
                if (iStatus.Equals("1"))
                {
                    billActionType       = BillActionType.Open;
                    unitInfo.Status_Desc = "正常";
                    iType = 3;
                }
                else
                {
                    billActionType       = BillActionType.Stop;
                    unitInfo.Status_Desc = "停用";
                    iType = 4;
                }
                BillOperateStateService state = bs.ApproveBill(loggingSession, unit_id, "", billActionType);

                if (state == BillOperateStateService.ApproveSuccessful)
                {
                    if (SetUnitTableStatus(loggingSession, unit_id))
                    {
                        UnitInfo u2 = this.GetUnitById(loggingSession, unit_id);
                        if (u2 != null && u2.TypeId == "EB58F1B053694283B2B7610C9AAD2742")
                        {
#if SYN_AP
                            //单位类型是门店, 提交管理平台
                            if (!SetManagerExchangeUnitInfo(loggingSession, unitInfo, iType))
                            {
                                return(false);
                            }
#endif
                        }
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
示例#5
0
        //#endregion 用户

        #region 用户的状态处理
        /// <summary>
        /// 用户停用/启用方法
        /// </summary>
        /// <param name="user_id">用户标识</param>
        /// <param name="iStatus">用户状态</param>
        /// <param name="LoggingSessionInfo">登录用户Session类</param>
        /// <returns></returns>
        public bool SetUserStatus(string user_id, string iStatus, LoggingSessionInfo LoggingSessionInfo)
        {
            cSqlMapper.Instance().BeginTransaction();
            try
            {
                cPos.Service.cBillService bs = new cBillService();
                UserInfo userInfo            = new UserInfo();
                userInfo.User_Id = user_id;

                BillActionType billActionType;
                if (iStatus.Equals("1"))
                {
                    billActionType            = BillActionType.Open;
                    userInfo.User_Status_Desc = "正常";
                }
                else
                {
                    billActionType            = BillActionType.Stop;
                    userInfo.User_Status_Desc = "停用";
                }
                BillOperateStateService state = bs.ApproveBill(LoggingSessionInfo, user_id, "", billActionType);
                if (state == BillOperateStateService.ApproveSuccessful)
                {
                    if (SetUserTableStatus(LoggingSessionInfo, user_id))
                    {
#if SYN_AP
                        // 提交管理平台
                        if (!SetManagerExchangeUserInfo(LoggingSessionInfo, userInfo, 3))
                        {
                            cSqlMapper.Instance().RollBackTransaction();
                            return(false);
                        }
#endif
                        cSqlMapper.Instance().CommitTransaction();
                        return(true);
                    }
                    else
                    {
                        cSqlMapper.Instance().RollBackTransaction();
                        return(false);
                    }
                }
                else
                {
                    cSqlMapper.Instance().RollBackTransaction();
                    return(false);
                }
            }
            catch (Exception ex)
            {
                cSqlMapper.Instance().RollBackTransaction();
                throw (ex);
            }
        }
示例#6
0
        /// <summary>
        /// Inout状态修改(审核,删除。。。。)
        /// </summary>
        /// <param name="loggingSessionInfo"></param>
        /// <param name="order_id"></param>
        /// <param name="billActionType"></param>
        /// <param name="strError">输出信息</param>
        /// <returns></returns>
        public bool SetInoutOrderStatus(LoggingSessionInfo loggingSessionInfo, string order_id, BillActionType billActionType, out string strError)
        {
            string strResult = string.Empty;

            try
            {
                cPos.Admin.Service.BillService bs = new BillService();

                BillOperateStateService state = bs.ApproveBill(loggingSessionInfo, order_id, "", billActionType, out strResult);
                if (state == BillOperateStateService.ApproveSuccessful)
                {
                    //获取要改变的表单信息
                    BillModel billInfo = new BillService().GetBillById(loggingSessionInfo, order_id);
                    //设置要改变的用户信息
                    InoutInfo inoutInfo = new InoutInfo();
                    inoutInfo.status         = billInfo.Status;
                    inoutInfo.status_desc    = billInfo.BillStatusDescription;
                    inoutInfo.order_id       = order_id;
                    inoutInfo.modify_user_id = loggingSessionInfo.CurrentUser.User_Id;
                    inoutInfo.modify_time    = GetCurrentDateTime(); //获取当前时间
                    if (billActionType == BillActionType.Approve)
                    {
                        inoutInfo.approve_time    = GetCurrentDateTime();
                        inoutInfo.approve_user_id = loggingSessionInfo.CurrentUser.User_Id;
                    }
                    //提交
                    MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).Update("Inout.UpdateStatus", inoutInfo);
                    strError = "审批成功";
                    return(true);
                }
                else
                {
                    strError = "获取状态失败--" + strResult;
                    return(false);
                }
            }
            catch (Exception ex)
            {
                strError = ex.ToString();
                throw (ex);
            }
        }
示例#7
0
        // <summary>
        /// 单子提交到表单
        /// </summary>
        /// <param name="orderInfo"></param>
        /// <returns></returns>
        private bool SetOrderInfoInsertBill(OrderInfo orderInfo)
        {
            try
            {
                BillModel    bill = new BillModel();
                cBillService bs   = new cBillService(loggingSessionInfo);

                bill.Id = orderInfo.order_id;
                DataSet ds = new DataSet();
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    string order_type_id = bs.GetBillKindByCode(orderInfo.BillKindCode).Id;

                    bill.Code = new AppSysService(loggingSessionInfo).GetNo(orderInfo.BillKindCode);

                    bill.KindId    = order_type_id;
                    bill.UnitId    = loggingSessionInfo.CurrentUserRole.UnitId;
                    bill.AddUserId = loggingSessionInfo.CurrentUser.User_Id;

                    BillOperateStateService state = bs.InsertBill(bill);

                    if (state == BillOperateStateService.CreateSuccessful)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
示例#8
0
        /// <summary>
        /// 订单状态修改
        /// </summary>
        /// <param name="order_id"></param>
        /// <param name="billActionType"></param>
        /// <param name="strError"></param>
        /// <returns></returns>
        public bool SetCCStatusUpdate(string order_id, BillActionType billActionType, out string strError)
        {
            string strResult = string.Empty;

            try
            {
                CCInfo ccInfo = new CCInfo();
                ccInfo.order_id       = order_id;
                ccInfo.modify_user_id = loggingSessionInfo.CurrentUser.User_Id;
                ccInfo.modify_time    = GetCurrentDateTime(); //获取当前时间
                if (loggingSessionInfo.CurrentLoggingManager.IsApprove == null || loggingSessionInfo.CurrentLoggingManager.IsApprove.Equals("0"))
                {
                    switch (billActionType)
                    {
                    case BillActionType.Cancel:
                        ccInfo.status      = "-1";
                        ccInfo.status_desc = "删除";
                        break;

                    case BillActionType.Approve:
                        ccInfo.status          = "10";
                        ccInfo.status_desc     = "已审批";
                        ccInfo.approve_time    = GetCurrentDateTime();
                        ccInfo.approve_user_id = loggingSessionInfo.CurrentUser.User_Id;
                        break;

                    case BillActionType.Reject:
                        ccInfo.status      = "1";
                        ccInfo.status_desc = "未审批";
                        break;

                    case BillActionType.Create:
                        ccInfo.status      = "1";
                        ccInfo.status_desc = "未审批";
                        break;

                    default:
                        ccInfo.status      = "1";
                        ccInfo.status_desc = "未审批";
                        break;
                    }
                }
                else
                {
                    cBillService bs = new cBillService(loggingSessionInfo);

                    BillOperateStateService state = bs.ApproveBill(order_id, "", billActionType, out strResult);
                    if (state == BillOperateStateService.ApproveSuccessful)
                    {
                        //获取要改变的表单信息
                        BillModel billInfo = bs.GetBillById(order_id);
                        //设置要改变的用户信息

                        ccInfo.status      = billInfo.Status;
                        ccInfo.status_desc = billInfo.BillStatusDescription;

                        if (billActionType == BillActionType.Approve)
                        {
                            ccInfo.approve_time    = GetCurrentDateTime();
                            ccInfo.approve_user_id = loggingSessionInfo.CurrentUser.User_Id;
                        }
                    }
                    else
                    {
                        strError = "获取状态失败--" + strResult;
                        return(false);
                    }
                }
                bool bReturn = ccService.SetCCStatusUpdate(ccInfo);
                strError = "操作成功";
                return(true);
            }
            catch (Exception ex)
            {
                strError = ex.ToString();
                throw (ex);
            }
        }