Esempio n. 1
0
        /// <summary>
        /// 更改上传标志
        /// </summary>
        /// <param name="Customer_Id"></param>
        /// <param name="inoutInfo"></param>
        /// <returns></returns>
        public bool SetInoutIfFlagInfoWeb(string Customer_Id, InoutInfo inoutInfo)
        {
            LoggingManager loggingManager = new cLoggingManager().GetLoggingManager(Customer_Id);

            cSqlMapper.Instance(loggingManager).Update("Inout.UpdateUnDownloadIfFlag", inoutInfo);
            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// 调价单提交到表单
        /// </summary>
        /// <param name="loggingSessionInfo"></param>
        /// <param name="inoutInfo"></param>
        /// <returns></returns>
        private bool SetInoutOrderInsertBill(LoggingSessionInfo loggingSessionInfo, InoutInfo inoutInfo)
        {
            try
            {
                cPos.Model.BillModel           bill = new BillModel();
                cPos.Admin.Service.BillService bs   = new BillService();

                bill.Id = inoutInfo.order_id;
                string order_type_id = bs.GetBillKindByCode(loggingSessionInfo, inoutInfo.BillKindCode).Id.ToString(); //loggingSession, OrderType
                bill.Code      = bs.GetBillNextCode(loggingSessionInfo, inoutInfo.BillKindCode);                       //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);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 打包
        /// </summary>
        /// <param name="Customer_Id">客户标识</param>
        /// <param name="Unit_Id">组织标识</param>
        /// <param name="maxRowCount">最大行数</param>
        /// <param name="startRowIndex">开始行号</param>
        /// <param name="bat_id">批次号</param>
        /// <returns></returns>
        public IList <InoutInfo> GetPosInoutListPackagedWeb(string Customer_Id, string Unit_Id, int maxRowCount, int startRowIndex, string bat_id)
        {
            //设置参数
            OrderSearchInfo orderSearchInfo = new OrderSearchInfo();

            orderSearchInfo.customer_id     = Customer_Id;
            orderSearchInfo.unit_id         = Unit_Id;
            orderSearchInfo.order_type_id   = "1F0A100C42484454BAEA211D4C14B80F";
            orderSearchInfo.order_reason_id = "2F6891A2194A4BBAB6F17B4C99A6C6F5";
            orderSearchInfo.StartRow        = startRowIndex;
            orderSearchInfo.EndRow          = startRowIndex + maxRowCount;

            //
            InoutService inoutService = new InoutService();
            //获取集合
            IList <InoutInfo> inoutInfoList = new List <InoutInfo>();

            inoutInfoList = inoutService.GetInoutListPackagedWeb(orderSearchInfo);
            if (inoutInfoList.Count > 0)
            {
                //修改获取的监控信息批次号
                InoutInfo inoutInfo = new InoutInfo();
                inoutInfo.bat_id        = bat_id;
                inoutInfo.InoutInfoList = inoutInfoList;
                bool b = inoutService.SetInoutUpdateUnDownloadBatIdWeb(Customer_Id, inoutInfo);
            }
            return(inoutInfoList);
        }
Esempio n. 4
0
        /// <summary>
        /// 根据状态与组织获取相关的调整单集合
        /// </summary>
        /// <param name="loggingSessionInfo">登录model</param>
        /// <param name="unit_id">组织</param>
        /// <param name="status">状态值</param>
        /// <returns></returns>
        public IList <InoutInfo> GetAJListByStatus(LoggingSessionInfo loggingSessionInfo, string unit_id, string status)
        {
            try
            {
                IList <InoutInfo> inoutInfoList   = new List <InoutInfo>();
                OrderSearchInfo   orderSearchInfo = new OrderSearchInfo();
                orderSearchInfo.unit_id = unit_id;
                //orderSearchInfo.sales_unit_id = unit_id;
                orderSearchInfo.status        = status;
                orderSearchInfo.order_type_id = "5F11A199E3CD42DE9CAE70442FC3D991";
                orderSearchInfo.StartRow      = 0;
                orderSearchInfo.EndRow        = 36500;

                InoutInfo inoutInfo = new InoutInfo();
                inoutInfo     = new InoutService().SearchInoutInfo(loggingSessionInfo, orderSearchInfo);
                inoutInfoList = inoutInfo.InoutInfoList;
                foreach (InoutInfo inout in inoutInfoList)
                {
                    inout.InoutDetailList = new InoutService().GetInoutDetailInfoByOrderId(loggingSessionInfo, inout.order_id);
                }
                return(inoutInfoList);
            }
            catch (Exception ex) {
                throw (ex);
            }
        }
        protected override OrderOperationRD ProcessRequest(DTO.Base.APIRequest <BatchInvalidShipRP> pRequest)
        {
            var rd   = new OrderOperationRD();
            var para = pRequest.Parameters;
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var T_Iount            = new T_InoutBLL(loggingSessionInfo);

            var OrderList = new List <InoutInfo>();

            foreach (var item in para.OrderList)
            {
                if (item.Status.Equals("500"))
                {
                    var Entity = new InoutInfo()
                    {
                        order_id   = item.OrderID,
                        Field2     = item.DeliverOrder,
                        carrier_id = item.DeliverCompanyID,
                        Field9     = item.Field9
                    };
                    OrderList.Add(Entity);
                }
            }

            int num = T_Iount.BatchInvalidShip(OrderList, para.Remark, loggingSessionInfo);

            rd.Message = "操作成功" + num + "条!";
            return(rd);
        }
Esempio n. 6
0
 /// <summary>
 /// 批量修改上传标志
 /// </summary>
 /// <param name="loggingSessionInfo">登录model</param>
 /// <param name="if_flag">上传标志</param>
 /// <param name="InoutInfoList">单据集合</param>
 /// <param name="IsTrans">是否提交</param>
 /// <returns></returns>
 public bool SetInoutIfFlag(LoggingSessionInfo loggingSessionInfo, string if_flag, IList <InoutInfo> InoutInfoList, bool IsTrans)
 {
     if (IsTrans)
     {
         MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).BeginTransaction();
     }
     try
     {
         bool      bReturn   = false;
         InoutInfo inoutInfo = new InoutInfo();
         inoutInfo.if_flag        = if_flag;
         inoutInfo.InoutInfoList  = InoutInfoList;
         inoutInfo.modify_time    = GetCurrentDateTime();
         inoutInfo.modify_user_id = loggingSessionInfo.CurrentUser.User_Id;
         MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).Update("Inout.UpdateIfflag", inoutInfo);
         if (IsTrans)
         {
             MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).CommitTransaction();
         }
         return(bReturn);
     }
     catch (Exception ex)
     {
         if (IsTrans)
         {
             MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).RollBackTransaction();
         }
         throw (ex);
     }
 }
Esempio n. 7
0
        /// <summary>
        /// 保存调整单(新建修改)
        /// </summary>
        /// <param name="loggingSessionInfo">登录model</param>
        /// <param name="IsTrans">是否批处理</param>
        /// <param name="inoutInfo">进入库模板</param>
        /// <param name="strError">输出错误信息</param>
        /// <returns></returns>
        public bool SetAJInfo(LoggingSessionInfo loggingSessionInfo, bool IsTrans, InoutInfo inoutInfo, out string strError)
        {
            if (IsTrans)
            {
                cSqlMapper.Instance().BeginTransaction();
            }
            try
            {
                InoutService inoutService = new InoutService();

                if (inoutInfo.order_type_id == null || inoutInfo.order_type_id.Equals(""))
                {
                    inoutInfo.order_type_id = "5F11A199E3CD42DE9CAE70442FC3D991";
                }
                if (inoutInfo.BillKindCode == null || inoutInfo.BillKindCode.Equals(""))
                {
                    inoutInfo.BillKindCode = "AJ";
                }
                if (inoutInfo.data_from_id == null || inoutInfo.data_from_id.Equals(""))
                {
                    inoutInfo.data_from_id = "B8DF5D46D3CA430ABE21E20F8D71E212";
                }

                if (inoutInfo.operate == null || inoutInfo.operate.Equals(""))
                {
                    inoutInfo.operate = "Create";
                }

                if (inoutInfo.sales_unit_id == null || inoutInfo.sales_unit_id.Equals(""))
                {
                    if (inoutInfo.unit_id != null && (!inoutInfo.unit_id.Equals("")))
                    {
                        inoutInfo.sales_unit_id = inoutInfo.unit_id;
                    }
                }
                if (inoutService.SetInoutInfo(loggingSessionInfo, inoutInfo, false, out strError))
                {
                    if (IsTrans)
                    {
                        cSqlMapper.Instance().CommitTransaction();
                    }
                    return(true);
                }
                else
                {
                    if (IsTrans)
                    {
                        cSqlMapper.Instance().RollBackTransaction();
                    }
                    return(false);
                }
            }
            catch (Exception ex) {
                if (IsTrans)
                {
                    cSqlMapper.Instance().RollBackTransaction();
                }
                throw (ex);
            }
        }
        protected override OrderOperationRD ProcessRequest(DTO.Base.APIRequest <BatchInvalidOrderRP> pRequest)
        {
            var rd   = new OrderOperationRD();
            var para = pRequest.Parameters;
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var T_Iount            = new T_InoutBLL(loggingSessionInfo);

            //审核不通过:900
            //未发货:500
            //待提货:510
            //备货中:410
            //未审核:100
            var OrderList = new List <InoutInfo>();

            foreach (var item in para.OrderList)
            {
                if (item.Status.Equals("900") || item.Status.Equals("500") || item.Status.Equals("510") || item.Status.Equals("410") || item.Status.Equals("100"))
                {
                    var Entity = new InoutInfo()
                    {
                        order_id      = item.OrderID,
                        OldStatusDesc = item.StatusDesc
                    };
                    OrderList.Add(Entity);
                }
            }

            int num = T_Iount.BatchInvalidOrder(OrderList, para.Remark, loggingSessionInfo);

            rd.Message = "操作成功" + num + "条!";
            return(rd);
        }
Esempio n. 9
0
        /// <summary>
        /// 根据状态与组织获取相关的配送单集合
        /// </summary>
        /// <param name="loggingSessionInfo">登录model</param>
        /// <param name="unit_id">组织</param>
        /// <param name="status">状态值</param>
        /// <returns></returns>
        public IList <InoutInfo> GetDistributionListByStatus(LoggingSessionInfo loggingSessionInfo, string unit_id, string status)
        {
            try
            {
                IList <InoutInfo> inoutInfoList   = new List <InoutInfo>();
                OrderSearchInfo   orderSearchInfo = new OrderSearchInfo();
                orderSearchInfo.unit_id = unit_id;
                //orderSearchInfo.sales_unit_id = unit_id;
                orderSearchInfo.status                  = status;
                orderSearchInfo.order_type_id           = "6F4991A2F4A84CC3902BD880BF540DF1";
                orderSearchInfo.order_reason_id         = "BAFA1B7A50914599BD7DC830B53203FA";
                orderSearchInfo.sales_unit_id_not_equal = unit_id;
                orderSearchInfo.purchase_unit_id        = unit_id;
                orderSearchInfo.if_flag                 = "0";
                orderSearchInfo.StartRow                = 0;
                orderSearchInfo.EndRow                  = 36500;

                InoutInfo inoutInfo = new InoutInfo();
                inoutInfo     = new InoutService().SearchInoutInfo(loggingSessionInfo, orderSearchInfo);
                inoutInfoList = inoutInfo.InoutInfoList;
                foreach (InoutInfo inout in inoutInfoList)
                {
                    inout.InoutDetailList = new InoutService().GetInoutDetailInfoByOrderId(loggingSessionInfo, inout.order_id);
                }
                return(inoutInfoList);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// 更改上传标志
        /// </summary>
        /// <param name="loggingSessionInfo">登录model</param>
        /// <param name="bat_id">批次标识</param>
        /// <param name="strError">错误信息返回</param>
        /// <returns></returns>
        public bool SetInoutOrderIfFlagInfo(LoggingSessionInfo loggingSessionInfo, string bat_id, out string strError)
        {
            InoutInfo inoutInfo = new InoutInfo();

            inoutInfo.bat_id = bat_id;

            cSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).Update("Inout.UpdateUnDownloadIfFlag", inoutInfo);
            strError = "Success";
            return(true);
        }
Esempio n. 11
0
        public int getEventItemSalesCount(InoutInfo entity)
        {
            string sql = getEventItemSalesSql(entity);

            sql += " select count(*) count From #tmp a ";
            DataSet ds  = new DataSet();
            var     obj = this.SQLHelper.ExecuteScalar(sql);

            return(obj == null || obj == DBNull.Value ? 0 : Convert.ToInt32(obj));
        }
Esempio n. 12
0
        /// <summary>
        /// 更新Pos小票表打包标识方法
        /// </summary>
        /// <param name="Customer_Id">客户标识</param>
        /// <param name="bat_id">批次标识</param>
        /// <param name="strError">错误信息返回</param>
        /// <returns></returns>
        public bool SetPosInoutIfFlagInfoWeb(string Customer_Id, string bat_id, out string strError)
        {
            InoutInfo inoutInfo = new InoutInfo();

            inoutInfo.bat_id = bat_id;
            InoutService inoutService = new InoutService();
            bool         b            = inoutService.SetInoutIfFlagInfoWeb(Customer_Id, inoutInfo);

            strError = "Success";
            return(b);
        }
Esempio n. 13
0
        public string getEventOrdersSql(InoutInfo entity)
        {
            string sql = "select a.* ";

            sql += "  ";
            sql += " ,displayIndex=row_number() over(order by a.Create_Time desc) ";
            sql += " into #tmp from t_inout a ";
            sql += " where a.status<>'-1' ";
            sql += " and a.Field18='" + entity.Field18.ToString() + "' ";
            sql += " order by displayIndex ";
            return(sql);
        }
Esempio n. 14
0
        /// <summary>
        /// 设置记录配送单打包批次号
        /// </summary>
        /// <param name="Customer_Id">客户标识</param>
        /// <param name="User_Id">用户标识</param>
        /// <param name="Unit_Id">组织标识</param>
        /// <param name="bat_id">批次号</param>
        /// <param name="inoutInfoList">配送单集合</param>
        /// <returns>true=成功,false=失败</returns>
        public bool SetDistributionBatInfo(string Customer_Id, string User_Id, string Unit_Id, string bat_id, IList <InoutInfo> inoutInfoList)
        {
            LoggingSessionInfo loggingSessionInfo = GetLoggingSessionInfo(Customer_Id, User_Id, Unit_Id);

            cPos.Service.InoutService server = new cPos.Service.InoutService();
            InoutInfo inoutInfo = new InoutInfo();

            inoutInfo.bat_id        = bat_id;
            inoutInfo.InoutInfoList = inoutInfoList;
            bool b = server.SetInoutUpdateUnDownloadBatIdWeb(Customer_Id, inoutInfo);

            return(b);
        }
Esempio n. 15
0
 /// <summary>
 /// 下载进出库单明细
 /// </summary>
 /// <param name="Customer_Id">客户标识</param>
 /// <param name="Unit_Id">组织标识</param>
 /// <param name="inoutInfoList"></param>
 /// <returns></returns>
 public IList <InoutDetailInfo> GetInoutDetailListPackageWeb(string Customer_Id, string Unit_Id, List <InoutInfo> inoutInfoList)
 {
     try
     {
         LoggingManager loggingManager = new cLoggingManager().GetLoggingManager(Customer_Id);
         InoutInfo      inoutInfo      = new InoutInfo();
         inoutInfo.InoutInfoList = inoutInfoList;
         return(cSqlMapper.Instance(loggingManager).QueryForList <InoutDetailInfo>("InoutDetail.SelectUnDownloadInoutDetail", inoutInfo));
     }
     catch (Exception ex) {
         return(null);
     }
 }
Esempio n. 16
0
        public string getEventItemSalesSql(InoutInfo entity)
        {
            string sql = "select a.*,c.item_id,d.imageUrl ";

            sql += " ,displayIndex=row_number() over(order by a.Create_Time desc) ";
            sql += " into #tmp from t_inout_detail a ";
            sql += " left join t_inout b on a.order_id=b.order_id ";
            sql += " left join vw_sku c on a.sku_id=c.sku_id ";
            sql += " left join t_item d on d.item_id=c.item_id ";
            sql += " where a.order_detail_status<>'-1' and b.status<>'-1' ";
            sql += " and b.Field18='" + entity.Field18.ToString() + "' ";
            sql += " order by displayIndex ";
            return(sql);
        }
        protected string GetOrderStr2(InoutInfo order)
        {
            string str = "<li>";

            str += string.Format("<div style=\"float: left; width: 30%; text-align:center;\">{0}&nbsp;</div>", order.order_no);
            str += string.Format("<div style=\"float: left; width: 10%; text-align:center;\">{0}&nbsp;</div>", order.vip_name);
            str += string.Format("<div style=\"float: left; width: 17%; text-align:center;\">{0,25:N}元&nbsp;&nbsp;</div>", order.total_amount);
            str += string.Format("<div style=\"float: left; width: 25%; text-align:center;\">{0}<br/>{1}</div>", order.Field8, order.Field4);
            str += string.Format("<div style=\"float: left; width: 18%; text-align:center;\">{0}&nbsp;</div>",
                                 order.modify_time == null || order.modify_time.Trim().Length == 0 ? string.Empty :
                                 Convert.ToDateTime(order.modify_time).ToString("MM-dd HH:mm"));
            str += string.Format("</li>");
            return(str);
        }
Esempio n. 18
0
        /// <summary>
        /// 批量取消(作废)
        /// </summary>
        /// <param name="OrderID"></param>
        public int BatchInvalidOrder(List <InoutInfo> OrderList, string Remark, LoggingSessionInfo LoggingSessionInfo)
        {
            var UpdateOrderList = new List <InoutInfo>();

            foreach (var item in OrderList)
            {
                var result = this._currentDAO.GetByID(item.order_id);
                if (result != null)
                {
                    var Entity = new InoutInfo()
                    {
                        order_id      = result.order_id,
                        Field2        = result.Field2,
                        carrier_id    = result.carrier_id,
                        status        = "800",
                        status_desc   = "已取消",
                        OldStatusDesc = item.OldStatusDesc
                    };
                    UpdateOrderList.Add(Entity);
                }
            }
            //更新订单状态
            int Num = this._currentDAO.BatchChangeOrderStatus(UpdateOrderList);

            if (Num > 0)
            {//添加状态操作记录
                var inoutStatus = new TInoutStatusBLL(LoggingSessionInfo);
                foreach (var itemes in UpdateOrderList)
                {
                    var info = new TInoutStatusEntity()
                    {
                        InoutStatusID = Guid.Parse(Utils.NewGuid()),
                        OrderID       = itemes.order_id,
                        CustomerID    = LoggingSessionInfo.ClientID,
                        Remark        = Remark,
                        OrderStatus   = 800,
                        StatusRemark  = "订单状态从" + itemes.OldStatusDesc + "变为已取消[操作人:" + LoggingSessionInfo.CurrentUser.User_Name + "]"
                    };
                    //执行
                    inoutStatus.Create(info);

                    //执行取消订单业务
                    SetCancelOrder(itemes.order_id, 0, LoggingSessionInfo);
                }
                //
                Num = UpdateOrderList.Count();
            }
            return(Num);
        }
Esempio n. 19
0
        /// <summary>
        /// 产品销量汇总
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public DataSet getEventItemSales(InoutInfo entity, int page, int pageSize)
        {
            page     = page <= 0 ? 1 : page;
            pageSize = pageSize <= 0 ? 15 : pageSize;
            int beginSize = (page - 1) * pageSize + 1;
            int endSize   = (page - 1) * pageSize + pageSize;

            string sql = getEventItemSalesSql(entity);

            sql += " select * From #tmp a where 1=1 and a.displayIndex between '" + beginSize + "' and '" + endSize + "' order by a.displayindex";
            DataSet ds = new DataSet();

            ds = this.SQLHelper.ExecuteDataset(sql);
            return(ds);
        }
Esempio n. 20
0
 /// <summary>
 /// 获取单个进出库单据的详细信息
 /// </summary>
 /// <param name="loggingSessionInfo"></param>
 /// <param name="orderId"></param>
 /// <returns></returns>
 public InoutInfo GetInoutInfoById(LoggingSessionInfo loggingSessionInfo, string orderId)
 {
     try
     {
         Hashtable _ht = new Hashtable();
         _ht.Add("OrderId", orderId);
         InoutInfo inoutInfo = new InoutInfo();
         inoutInfo = (InoutInfo)cSqlMapper.Instance().QueryForObject("Inout.SelectById", _ht);
         inoutInfo.InoutDetailList = GetInoutDetailInfoByOrderId(loggingSessionInfo, orderId);
         return(inoutInfo);
     }
     catch (Exception ex) {
         throw (ex);
     }
 }
Esempio n. 21
0
    //从界面获取数据
    private InoutInfo GetDataFromUI()
    {
        var inoutInfo = new InoutInfo();

        inoutInfo.order_no          = tbOrderNo.Text;
        inoutInfo.order_reason_id   = selReasonType.SelectedValue;
        inoutInfo.order_reason_name = selReasonType.SelectedItem.Text;
        inoutInfo.sales_unit_id     = selSalesUnit.SelectedValue;
        inoutInfo.purchase_unit_id  = selPurchaseUnit.SelectedValue;
        inoutInfo.warehouse_id      = selWarehouse.SelectedValue;
        inoutInfo.order_date        = selOrderDate.Value;
        inoutInfo.complete_date     = selCompleteDate.Value;
        inoutInfo.ref_order_no      = tbRefOrderNo.Text;
        decimal total = 0;

        Decimal.TryParse(this.hidTotalAmount.Value, out total);
        inoutInfo.total_amount = total;
        inoutInfo.remark       = tbRemark.Text;
        decimal rate = 0;

        Decimal.TryParse(this.tbDiscountRate.Text, out rate);
        inoutInfo.discount_rate = rate;
        inoutInfo.order_type_id = "1F0A100C42484454BAEA211D4C14B80F";
        inoutInfo.BillKindCode  = "DO";
        inoutInfo.data_from_id  = "B8DF5D46D3CA430ABE21E20F8D71E212";
        inoutInfo.red_flag      = "1";

        if (ViewState["action"].ToString() == "Create")
        {
            inoutInfo.operate        = "Create";
            inoutInfo.order_id       = "";
            inoutInfo.status         = "1";//modify by lihao 2012-8-3
            inoutInfo.create_time    = new cPos.Service.BaseService().GetCurrentDateTime();
            inoutInfo.create_user_id = loggingSessionInfo.CurrentUser.User_Id;
        }
        else
        {
            inoutInfo.operate  = "Modify";
            inoutInfo.order_id = this.Request.QueryString["order_id"];
            // inoutInfo.status = "";//modify by lihao 2012-8-3
            inoutInfo.modify_time    = new cPos.Service.BaseService().GetCurrentDateTime();
            inoutInfo.modify_user_id = loggingSessionInfo.CurrentUser.User_Id;
        }
        inoutInfo.InoutDetailList = SerializeFromUI();
        return(inoutInfo);
    }
Esempio n. 22
0
    private void TestInoutDetail()
    {
        List <InoutInfo> inoutInfoList = new List <InoutInfo>();
        InoutInfo        inoutInfo     = new InoutInfo();

        inoutInfo.order_id = "065ce71a390e4d7580c22852575a99a7";
        inoutInfoList.Add(inoutInfo);

        InoutInfo inoutInfo1 = new InoutInfo();

        inoutInfo1.order_id = "24e5078c2b004d73b8a0a7af0f8dee68";
        inoutInfoList.Add(inoutInfo1);

        PosInoutService piService = new PosInoutService();

        this.GridView2.DataSource = piService.GetPosInoutDetailListPackageWeb("29E11BDC6DAC439896958CC6866FF64E", "", inoutInfoList);
        GridView2.DataBind();
    }
Esempio n. 23
0
 /// <summary>
 /// inout 单据查询
 /// </summary>
 /// <param name="loggingSessionInfo"></param>
 /// <param name="orderSearchInfo"></param>
 /// <returns></returns>
 public InoutInfo SearchInoutInfo(LoggingSessionInfo loggingSessionInfo, OrderSearchInfo orderSearchInfo)
 {
     try
     {
         orderSearchInfo.customer_id = loggingSessionInfo.CurrentLoggingManager.Customer_Id;
         InoutInfo         inoutInfo     = new InoutInfo();
         int               iCount        = MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).QueryForObject <int>("Inout.SearchCount", orderSearchInfo);
         IList <InoutInfo> inoutInfoList = new List <InoutInfo>();
         inoutInfoList           = MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).QueryForList <InoutInfo>("Inout.Search", orderSearchInfo);
         inoutInfo.ICount        = iCount;
         inoutInfo.InoutInfoList = inoutInfoList;
         return(inoutInfo);
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
Esempio n. 24
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);
            }
        }
Esempio n. 25
0
    //保存AJBill的数据
    private InoutInfo currentajbillData()
    {
        InoutInfo ajbill = new InoutInfo();

        ajbill.order_no        = this.tbOrderNo.Text;
        ajbill.order_reason_id = this.selReasonType.SelectedValue;
        ajbill.unit_id         = this.drpUnit.SelectedValue;
        ajbill.warehouse_id    = this.selWarehouse.SelectedValue;
        //ajbill.complete_date = this.tbCompleteDate.Value;
        ajbill.ref_order_no = this.tbCompleteDate.Value;
        ajbill.order_date   = this.selOrderDate.Value;
        ajbill.remark       = this.tbRemark.Text;
        ajbill.red_flag     = "1";
        if (ViewState["action"].ToString() == "Create")
        {
            ajbill.operate        = "Create";
            ajbill.order_id       = "";
            ajbill.status         = "1";
            ajbill.create_time    = new BaseService().GetCurrentDateTime();
            ajbill.create_user_id = loggingSessionInfo.CurrentUser.User_Id;
        }
        else
        {
            ajbill.operate = "Modify";
            // ajbill.status = "";
            ajbill.order_id       = this.Request.QueryString["order_id"];
            ajbill.modify_time    = new BaseService().GetCurrentDateTime();
            ajbill.modify_user_id = loggingSessionInfo.CurrentUser.User_Id;
        }
        IList <InoutDetailInfo> inoutdetailList = saveItemDetailList();
        decimal total_qty = 0;

        foreach (var item in inoutdetailList)
        {
            total_qty += item.enter_qty;
        }
        ajbill.total_qty       = total_qty;
        ajbill.InoutDetailList = inoutdetailList;
        return(ajbill);
    }
Esempio n. 26
0
        /// <summary>
        /// 调整单查询
        /// </summary>
        /// <param name="loggingSessionInfo">登录model</param>
        /// <param name="order_no">单据号</param>
        /// <param name="status">状态</param>
        /// <param name="unit_id">单位</param>
        /// <param name="warehouse_id">仓库</param>
        /// <param name="order_date_begin">开始日期(yyyy-MM-dd)</param>
        /// <param name="order_date_end">结束日期(yyyy-MM-dd)</param>
        /// <param name="order_reason_type_id">类型2</param>
        /// <param name="ref_order_no">上级单号</param>
        /// <param name="data_from_id">来源</param>
        /// <param name="maxRowCount">当前页数量</param>
        /// <param name="startRowIndex">开始数量</param>
        /// <returns></returns>
        public InoutInfo SearchAJInfo(LoggingSessionInfo loggingSessionInfo
                                      , string order_no
                                      , string status
                                      , string unit_id
                                      , string warehouse_id
                                      , string order_date_begin
                                      , string order_date_end
                                      , string order_reason_type_id
                                      , string ref_order_no
                                      , string data_from_id
                                      , int maxRowCount
                                      , int startRowIndex
                                      )
        {
            try
            {
                InoutInfo       inoutInfo       = new InoutInfo();
                OrderSearchInfo orderSearchInfo = new OrderSearchInfo();
                orderSearchInfo.order_no         = order_no;
                orderSearchInfo.status           = status;
                orderSearchInfo.unit_id          = unit_id;
                orderSearchInfo.warehouse_id     = warehouse_id;
                orderSearchInfo.order_date_begin = order_date_begin;
                orderSearchInfo.order_date_end   = order_date_end;
                orderSearchInfo.order_reason_id  = order_reason_type_id;
                orderSearchInfo.ref_order_no     = ref_order_no;
                orderSearchInfo.data_from_id     = data_from_id;
                orderSearchInfo.StartRow         = startRowIndex;
                orderSearchInfo.EndRow           = startRowIndex + maxRowCount;

                orderSearchInfo.order_type_id = "5F11A199E3CD42DE9CAE70442FC3D991";
                InoutService inoutService = new InoutService();
                inoutInfo = inoutService.SearchInoutInfo(loggingSessionInfo, orderSearchInfo);

                return(inoutInfo);
            }
            catch (Exception ex) {
                throw (ex);
            }
        }
Esempio n. 27
0
        /// <summary>
        /// 出入库单据查询
        /// </summary>
        /// <param name="loggingSessionInfo">登录用户信息集合</param>
        /// <param name="order_no">单据号码</param>
        /// <param name="order_reason_type_id">类型标识</param>
        /// <param name="sales_unit_id">销售单位标识</param>
        /// <param name="warehouse_id">仓库标识</param>
        /// <param name="purchase_unit_id">采购单位标识</param>
        /// <param name="status">状态code</param>
        /// <param name="order_date_begin">单据日期起(yyyy-MM-dd)</param>
        /// <param name="order_date_end">单据日期止(yyyy-MM-dd)</param>
        /// <param name="complete_date_begin">完成日期起(yyyy-MM-dd)</param>
        /// <param name="complete_date_end">完成日期止(yyyy-MM-dd)</param>
        /// <param name="data_from_id">数据来源标识</param>
        /// <param name="ref_order_no">原单据号码</param>
        /// <param name="order_type_id">出入库单据标签:(出库单=1F0A100C42484454BAEA211D4C14B80F,入库单=C1D407738E1143648BC7980468A399B8)</param>
        /// <param name="maxRowCount">当前页显示数量</param>
        /// <param name="startRowIndex">当前页开始数量</param>
        /// <returns></returns>
        public InoutInfo SearchInoutInfo(LoggingSessionInfo loggingSessionInfo
                                         , string order_no
                                         , string order_reason_type_id
                                         , string sales_unit_id
                                         , string warehouse_id
                                         , string purchase_unit_id
                                         , string status
                                         , string order_date_begin
                                         , string order_date_end
                                         , string complete_date_begin
                                         , string complete_date_end
                                         , string data_from_id
                                         , string ref_order_no
                                         , string order_type_id
                                         , int maxRowCount
                                         , int startRowIndex)
        {
            InoutInfo       inoutInfo       = new InoutInfo();
            OrderSearchInfo orderSearchInfo = new OrderSearchInfo();

            orderSearchInfo.order_no            = order_no;
            orderSearchInfo.order_reason_id     = order_reason_type_id;
            orderSearchInfo.sales_unit_id       = sales_unit_id;
            orderSearchInfo.warehouse_id        = warehouse_id;
            orderSearchInfo.purchase_unit_id    = purchase_unit_id;
            orderSearchInfo.status              = status;
            orderSearchInfo.order_date_begin    = order_date_begin;
            orderSearchInfo.order_date_end      = order_date_end;
            orderSearchInfo.complete_date_begin = complete_date_begin;
            orderSearchInfo.complete_date_end   = complete_date_end;
            orderSearchInfo.data_from_id        = data_from_id;
            orderSearchInfo.ref_order_no        = ref_order_no;
            orderSearchInfo.order_type_id       = order_type_id;
            orderSearchInfo.StartRow            = startRowIndex;
            orderSearchInfo.EndRow              = startRowIndex + maxRowCount;
            orderSearchInfo.customer_id         = loggingSessionInfo.CurrentLoggingManager.Customer_Id;

            inoutInfo = SearchInoutInfo(loggingSessionInfo, orderSearchInfo);
            return(inoutInfo);
        }
Esempio n. 28
0
        /// <summary>
        /// 产品销量汇总
        /// </summary>
        public InoutInfo getEventItemSales(InoutInfo entity, int page, int pageSize)
        {
            try
            {
                var result = new InoutInfo();

                IList <InoutDetailInfo> list = new List <InoutDetailInfo>();
                DataSet ds = _currentDAO.getEventItemSales(entity, page, pageSize);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    list = DataTableToObject.ConvertToList <InoutDetailInfo>(ds.Tables[0]);
                }

                result.ICount          = _currentDAO.getEventItemSalesCount(entity);
                result.InoutDetailList = list;
                return(result);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Esempio n. 29
0
 /// <summary>
 /// 提交inout信息
 /// </summary>
 /// <param name="loggingSessionInfo"></param>
 /// <param name="inoutInfo"></param>
 /// <returns></returns>
 private bool SetInoutTableInfo(LoggingSessionInfo loggingSessionInfo, InoutInfo inoutInfo)
 {
     try
     {
         if (inoutInfo != null)
         {
             inoutInfo.customer_id = loggingSessionInfo.CurrentLoggingManager.Customer_Id;
             if (inoutInfo.create_user_id == null || inoutInfo.create_user_id.Equals(""))
             {
                 inoutInfo.create_user_id = loggingSessionInfo.CurrentUser.User_Id;
                 inoutInfo.create_time    = GetCurrentDateTime();
             }
             if (inoutInfo.modify_user_id == null || inoutInfo.modify_user_id.Equals(""))
             {
                 inoutInfo.modify_user_id = loggingSessionInfo.CurrentUser.User_Id;
                 inoutInfo.modify_time    = GetCurrentDateTime();
             }
             if (inoutInfo.InoutDetailList != null)
             {
                 foreach (InoutDetailInfo inoutDetailInfo in inoutInfo.InoutDetailList)
                 {
                     if (inoutDetailInfo.order_detail_id == null || inoutDetailInfo.order_detail_id.Equals(""))
                     {
                         inoutDetailInfo.order_detail_id = NewGuid();
                     }
                     inoutDetailInfo.order_id = inoutInfo.order_id;
                 }
             }
             MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).Update("Inout.InsertOrUpdate", inoutInfo);
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
Esempio n. 30
0
        private void SetPaymentInfo()
        {
            // 创建一个新的 WebClient 实例.
            WebClient myWebClient = new WebClient();

            try
            {
                string strError          = string.Empty;
                string OrderCustomerInfo = Request["order_id"];
                Loggers.Debug(new DebugLogInfo()
                {
                    Message = string.Format("支付跳转--order_id: {0}", OrderCustomerInfo)
                });
                Loggers.Debug(new DebugLogInfo()
                {
                    Message = string.Format("支付跳转--merchant_url: {0}", Request["merchant_url"].ToString())
                });
                if (OrderCustomerInfo == null || OrderCustomerInfo.Trim().Equals(""))
                {
                    strError = "订单标识为空";
                    Loggers.Debug(new DebugLogInfo()
                    {
                        Message = string.Format("支付跳转--单据: {0}", strError)
                    });
                }
                else
                {
                    #region 处理业务
                    var infos = OrderCustomerInfo.Split(',');
                    if (infos.Length != 2)
                    {
                        Loggers.Debug(new DebugLogInfo()
                        {
                            Message = string.Format("支付跳转: {0}", "长度错误")
                        });
                        return;
                    }
                    string customerId         = infos[0].ToString().Trim();
                    string orderCode          = infos[1].ToString().Trim();
                    var    loggingSessionInfo = Default.GetBSLoggingSession(customerId, "1");

                    InoutService service   = new InoutService(loggingSessionInfo);
                    InoutInfo    inoutInfo = new InoutInfo();
                    inoutInfo = service.GetInoutInfoByOrderCode(orderCode);
                    if (inoutInfo == null)
                    {
                        strError = "没有获取合法的订单信息";
                        Loggers.Debug(new DebugLogInfo()
                        {
                            Message = string.Format("支付跳转 {0}", "没有获取合法的订单信息")
                        });
                    }
                    else
                    {
                        #region Jermyn20131011 处理订单支付时订单信息
                        InoutInfo inoutModel = new InoutInfo();
                        string    phone      = string.Empty;
                        string    address    = string.Empty;
                        string    userName   = string.Empty;
                        inoutModel.order_id    = inoutInfo.order_id;
                        inoutModel.modify_time = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        #region
                        if (Request["phone"] != null)
                        {
                            inoutModel.Field6 = Request["phone"].Trim();
                            Loggers.Debug(new DebugLogInfo()
                            {
                                Message = string.Format("手机号码: {0}", inoutModel.Field6)
                            });
                        }
                        //else {
                        //    Loggers.Debug(new DebugLogInfo()
                        //    {
                        //        Message = string.Format("支付跳转--手机号码 {0}", "为空")
                        //    });
                        //}
                        if (Request["address"] != null)
                        {
                            inoutModel.Field4 = Request["address"].Trim();
                            Loggers.Debug(new DebugLogInfo()
                            {
                                Message = string.Format("地址: {0}", inoutModel.Field4)
                            });
                        }
                        if (Request["userName"] != null)
                        {
                            inoutModel.Field14 = Request["userName"].Trim();
                            Loggers.Debug(new DebugLogInfo()
                            {
                                Message = string.Format("用户名: {0}", inoutModel.Field14)
                            });
                        }
                        #endregion
                        bool bReturn = service.Update(inoutModel, out strError);
                        Loggers.Debug(new DebugLogInfo()
                        {
                            Message = string.Format("更新订单用户信息是否成功: {0}", strError)
                        });
                        #endregion
                        //请求参数:
                        //order_id:  订单号
                        //prod_name:  产品名称
                        //prod_price:  产品价格
                        //merchant_url:  用户付款中途退出或者付款成功后返回URL http://xxxx:9004/OnlineClothing/detail.html?itemId=C5BBD04EEE1643F381A522AD68D58828&back=list&customerId=f6a7da3d28f74f2abedfc3ea0cf65c01
                        //call_back_url:  交易结果返回URL(最终将会以POST方式推送交易结果到该地址)
                        string uriString = ConfigurationManager.AppSettings["PaypalUrl"].Trim();
                        string webUrl    = ConfigurationManager.AppSettings["website_url"];
                        var    postData  = "order_id=" + OrderCustomerInfo
                                           + "&prod_name=" + inoutInfo.InoutDetailList[0].item_name
                                           + "&prod_price=" + Convert.ToString(double.Parse(Convert.ToString(inoutInfo.actual_amount)).ToString("f2"))
                                           + "&merchant_url=" + Request["merchant_url"]
                                           + "&call_back_url=" + webUrl + "OnlineShopping/data/OnlinePayAfter.aspx";
                        CustomerPayAssignBLL    customerPayServer = new CustomerPayAssignBLL(loggingSessionInfo);
                        CustomerPayAssignEntity customerPayInfo   = new CustomerPayAssignEntity();
                        var list = customerPayServer.QueryByEntity(new CustomerPayAssignEntity
                        {
                            CustomerId      = loggingSessionInfo.CurrentUser.customer_id
                            , IsDelete      = 0
                            , PaymentTypeId = "BB04817882B149838B19DE2BDDA5E91B"
                        }, null);
                        if (list != null && list.Length > 0)
                        {
                            customerPayInfo = list[0];
                            if (customerPayInfo != null && customerPayInfo.AssignId != null && !customerPayInfo.AssignId.Equals(""))
                            {
                                string strFLAmount = (double.Parse(Convert.ToString(Convert.ToDecimal(customerPayInfo.CustomerProportion) * Convert.ToDecimal(inoutInfo.actual_amount) / Convert.ToDecimal(100)))).ToString("f2");
                                postData += "&params=" + customerPayInfo.CustomerAccountNumber + "^" + strFLAmount + "^";
                            }
                        }

                        //order_id=1234
                        //&prod_name=test8
                        //&prod_price=0.02
                        //&merchant_url=http://xxxx
                        //&call_back_url=http://180.153.154.21:9004/AlipayWapTrade/PaySuccess.aspx
                        //&[email protected]^0.02^
                        Loggers.Debug(new DebugLogInfo()
                        {
                            Message = string.Format("支付跳转-链接字符串: {0}", postData)
                        });
                        // 注意这种拼字符串的ContentType
                        myWebClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
                        // 转化成二进制数组
                        byte[] byteArray = Encoding.UTF8.GetBytes(postData);
                        // 上传数据,并获取返回的二进制数据.
                        byte[] responseArray = myWebClient.UploadData(uriString, "POST", byteArray);
                        var    data          = System.Text.Encoding.UTF8.GetString(responseArray);
                        Response.Write(data);
                        strError = "ok";
                    }
                    #endregion
                }

                Loggers.Debug(new DebugLogInfo()
                {
                    Message = string.Format("支付跳转--完成: {0}", strError)
                });
                //myWebClient.UploadData(Request["merchant_url"].ToString(), "POST",Encoding.ASCII.GetBytes("&strError="+strError+""));
            }
            catch (Exception ex) {
                Loggers.Debug(new DebugLogInfo()
                {
                    Message = string.Format("支付跳转--出错: {0}", ex.ToString())
                });
                // myWebClient.UploadData(Request["merchant_url"].ToString(), "POST", Encoding.ASCII.GetBytes("&strError=" + ex.ToString() + ""));
            }
        }