Esempio n. 1
0
 //加载小票信息
 private void LoadPosInfo()
 {
     try
     {
         var source = new cPos.Service.InoutService().GetInoutInfoById(loggingSessionInfo, this.Request.QueryString["order_id"]);
         order_no.Text         = source.order_no ?? "";
         order_date.Text       = source.order_date ?? "";
         status_desc.Text      = source.status_desc ?? "";
         create_unit_name.Text = source.create_unit_name ?? "";
         pos_name.Text         = source.pos_id ?? "";
         tital_qty.Text        = source.total_qty.ToString();
         dicount_rate.Text     = source.discount_rate.ToString();
         total_amoount.Text    = source.total_amount.ToString();
         keep_the_change.Text  = source.keep_the_change.ToString();
         wiping_zero.Text      = source.wiping_zero.ToString();
         vip_no.Text           = source.vip_no ?? "";
         pos_name.Text         = source.sales_user;
         //cretae_user_name.Text = source.create_user_name ?? "";
         //send_user_name.Text = source.send_user_name ?? "";
         //accepet_user_name.Text = source.accpect_user_name ?? "";
         //create_time.Text = source.create_time ?? "";
         //send_time.Text = source.send_time ?? "";
         //accpect_time.Text = source.accpect_time ?? "";
         approve_user_name.Text = source.approve_user_name ?? "";
         approve_time.Text      = source.approve_time ?? "";
         remark.Text            = source.remark ?? "";
         this.InoutDetailInfos  = source.InoutDetailList;
     }
     catch (Exception ex)
     {
         PageLog.Current.Write(ex);
         this.InfoBox.ShowPopError("加载数据出错!");
     }
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request["shiftId"]))
         {
             string shiftid = Request["shiftId"];
             InoutInfo = new cPos.Service.InoutService().GetInoutListByShiftId(this.loggingSessionInfo, shiftid);
             var dto = InoutInfo.Select(obj => new UnitDetailDTO {
                 order_id = obj.order_id, create_time = obj.create_time, sales_user = obj.sales_user, order_no = obj.order_no, vip_no = obj.vip_no, payment_name = obj.payment_name, total_amount = obj.total_amount, create_user_name = obj.create_user_name
             });
             if (Session["_shift_detail"] == null)
             {
                 Session["_shift_detail"] = dto;
             }
             else
             {
                 var currentData = (IEnumerable <UnitDetailDTO>)Session["_shift_detail"];
                 var filterData  = dto.Where(obj => !currentData.Select(o => o.order_id).Contains(obj.order_id));
                 Session["_shift_detail"] = currentData.Union(filterData);
             }
             Query(0);
         }
     }
 }
Esempio n. 3
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. 4
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. 5
0
        /// <summary>
        /// 获取未打包的POS小票数量
        /// </summary>
        /// <param name="Customer_Id">客户标识</param>
        /// <param name="Unit_Id">组织标识</param>
        /// <returns></returns>
        public int GetPosInoutNotPackagedCountWeb(string Customer_Id, string Unit_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";
            //获取结果
            InoutService inoutService = new InoutService();
            int          icount       = inoutService.GetInoutNotPackagedCountWeb(orderSearchInfo);

            return(icount);
        }
Esempio n. 6
0
        /// <summary>
        /// 批量保存调整单
        /// </summary>
        /// <param name="loggingSessionInfo">登录model</param>
        /// <param name="inoutInfoList">调整单集合</param>
        /// <returns></returns>
        public bool SetAJInfoList(LoggingSessionInfo loggingSessionInfo, IList <InoutInfo> inoutInfoList)
        {
            cSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).BeginTransaction();
            string strError = string.Empty;

            try
            {
                bool bReturn = false;

                foreach (InoutInfo inoutInfo in inoutInfoList)
                {
                    //新建
                    bReturn = SetAJInfo(loggingSessionInfo, false, inoutInfo, out strError);
                    if (!bReturn)
                    {
                        break;
                    }
                    //审批
                    if (new cBillService().CanApproveBill(loggingSessionInfo, "", inoutInfo.order_id))
                    {
                        bReturn = new InoutService().SetInoutOrderStatus(loggingSessionInfo, inoutInfo.order_id, BillActionType.Approve, out strError);
                        if (!bReturn)
                        {
                            break;
                        }
                    }
                    //影响库存
                    bReturn = new StockBalanceService().SetStockBalance(loggingSessionInfo, inoutInfo.order_id);
                    if (!bReturn)
                    {
                        break;
                    }
                }
                cSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).CommitTransaction();
                return(true);
            }
            catch (Exception ex) {
                cSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).RollBackTransaction();
                throw (ex);
            }
        }
Esempio n. 7
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. 8
0
 /// <summary>
 /// 单个POS小票保存处理
 /// </summary>
 /// <param name="loggingSessionInfo">登录Model</param>
 /// <param name="inoutInfo">inoutmodel</param>
 /// <param name="IsTrans">是否批处理</param>
 /// <param name="strError">输出错误信息</param>
 /// <returns>返回真假</returns>
 public bool SetPosInoutInfo(LoggingSessionInfo loggingSessionInfo, InoutInfo inoutInfo, bool IsTrans, out string strError)
 {
     try
     {
         if (inoutInfo.order_id == null || inoutInfo.order_id.Equals(""))
         {
             inoutInfo.order_id = NewGuid();
         }
         if (inoutInfo.BillKindCode == null || inoutInfo.BillKindCode.Equals(""))
         {
             inoutInfo.BillKindCode = "DO";
         }
         string strResult             = string.Empty;
         cPos.Service.cBillService bs = new cBillService();
         if (bs.CanHaveBill(loggingSessionInfo, inoutInfo.order_id, out strResult))
         {
             //Jermyn20130717 单据重复也可以上传
             //throw (new System.Exception(inoutInfo.order_no + "单据重复"));
             inoutInfo.operate = "Modify";
         }
         if (inoutInfo.operate == null || inoutInfo.operate.Equals(""))
         {
             inoutInfo.operate = "Create";
         }
         //提交信息
         bool   bResult = new InoutService().SetInoutInfo(loggingSessionInfo, inoutInfo, IsTrans, out strResult);
         string aa      = strResult;
         #region
         if (bResult && inoutInfo.operate.Equals("Create"))
         {
             //审批
             if (new InoutService().SetInoutOrderStatus(loggingSessionInfo, inoutInfo.order_id, BillActionType.Approve, out strResult))
             {
                 //扣库存
                 if (new StockBalanceService().SetStockBalance(loggingSessionInfo, inoutInfo.order_id))
                 {
                     strError = "成功!";
                     return(true);
                 }
                 else
                 {
                     strError = "扣库存失败";
                     return(false);
                 }
             }
             else
             {
                 strError = "审批失败--" + aa + "--" + strResult;
                 throw (new System.Exception(strError));
             }
         }
         else
         {
             strError = strResult;
             //throw (new System.Exception(strError));
             return(bResult);
         }
         #endregion
     }
     catch (Exception ex) {
         throw (ex);
     }
 }
Esempio n. 9
0
        /// <summary>
        /// 获取需要打包的POS小票明细集合
        /// </summary>
        /// <param name="Customer_Id">客户标识</param>
        /// <param name="Unit_Id">组织标识</param>
        /// <param name="inoutInfoList">订单明细集合</param>
        /// <returns></returns>
        public IList <InoutDetailInfo> GetPosInoutDetailListPackageWeb(string Customer_Id, string Unit_Id, List <InoutInfo> inoutInfoList)
        {
            InoutService inoutService = new InoutService();

            return(inoutService.GetInoutDetailListPackageWeb(Customer_Id, Unit_Id, inoutInfoList));
        }