Esempio n. 1
0
        /// <summary>
        /// 销售发货:单据装载
        /// </summary>
        /// <param name="cDLCode"></param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public DispatchList Load(string cDLCode, out string errMsg)
        {
            //来源主表
            BLL.Service.DispatchList sMain = Common.Instance.Service.SA_Consignment_Load(Common.Instance.User.ConnectionString, cDLCode, out errMsg);
            if (sMain == null)
            {
                return(null);
            }

            //目标主表
            DispatchList  tMain = new DispatchList();
            DispatchLists tChild;

            //转换主表
            EntityConvert.ConvertClass <BLL.Service.DispatchList, DispatchList>(sMain, tMain);
            //循环转换子表
            foreach (BLL.Service.DispatchLists sChild in sMain.List)
            {
                tChild = new DispatchLists();
                EntityConvert.ConvertClass <BLL.Service.DispatchLists, DispatchLists>(sChild, tChild);
                ////存货转换
                //tChild.Inventory = new Inventory();
                //EntityConvert.ConvertClass<BLL.Service.Inventory, Inventory>(sChild.Inventory, tChild.Inventory);
                tMain.List.Add(tChild);
            }
            return(tMain);
        }
Esempio n. 2
0
        /// <summary>
        /// 根据盘点单、存货编码、批次查询盘点信息
        /// </summary>
        /// <param name="checkVouchs"></param>
        /// <param name="?"></param>
        /// <returns></returns>
        /// <remarks>tianzhenyun 2013-07-03</remarks>
        public bool SelectCheckVouch(ref CheckVouchs checkVouchs, out string errMsg)
        {
            BLL.Service.CheckVouchs tCheckVouchs = new BLL.Service.CheckVouchs();
            tCheckVouchs = EntityConvert.ConvertClass <CheckVouchs, BLL.Service.CheckVouchs>(checkVouchs, tCheckVouchs);

            bool flag = BLL.Common.Instance.Service.SelectCheckVouch(Common.Instance.User.ConnectionString, ref tCheckVouchs, out errMsg);

            if (flag)//如果为真,则转换对象
            {
                checkVouchs = EntityConvert.ConvertClass <BLL.Service.CheckVouchs, CheckVouchs>(tCheckVouchs, checkVouchs);
            }
            return(flag);
        }
Esempio n. 3
0
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public bool Login(User user)
        {
            //登录成功存储登录者信息
            this.user = new BLL.Service.User();
            this.user = EntityConvert.ConvertClass <Model.User, BLL.Service.User>(user, this.user);
            bool flag = service.Login(ref this.user);

            if (flag)
            {
                GetWarehouse();  //仓库
                GetCompetence(); //权限
            }
            return(flag);
        }
Esempio n. 4
0
        /// <summary>
        /// 保存盘点数量
        /// </summary>
        /// <param name="list"></param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        /// <remarks>tianzhenyun 2013-07-03</remarks>
        public bool SaveCheckVouch(List <CheckVouchs> list, out string errMsg)
        {
            //循环转换集合列表对象
            BLL.Service.CheckVouchs[] cvArray = new BLL.Service.CheckVouchs[list.Count];
            int i = 0;

            //目标对象
            BLL.Service.CheckVouchs tcv;
            foreach (CheckVouchs cv in list)
            {
                tcv = new BLL.Service.CheckVouchs();
                EntityConvert.ConvertClass <CheckVouchs, BLL.Service.CheckVouchs>(cv, tcv);
                cvArray[i++] = tcv;
            }
            //保存盘点数据
            return(Common.Instance.Service.SaveCheckVouch(Common.Instance.User.ConnectionString, cvArray, out errMsg));
        }
Esempio n. 5
0
        /// <summary>
        /// 销售发货:查询发货单列表
        /// </summary>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public List <Receipt> SelectList(out string errMsg)
        {
            List <Receipt> list = null;

            //转换仓库列表集合对象
            BLL.Service.Warehouse[] whList = new BLL.Service.Warehouse[Common.WarehouseList.Count];
            BLL.Service.Warehouse   tWh;//目标对象
            int i = 0;

            foreach (Warehouse wh in Common.WarehouseList)
            {
                tWh = new BLL.Service.Warehouse();
                EntityConvert.ConvertClass <Warehouse, BLL.Service.Warehouse>(wh, tWh);
                whList[i++] = tWh;
            }

            DataTable dt = Common.Instance.Service.SelectSaleDeliveryList(Common.Instance.User.ConnectionString, whList, out errMsg);

            if (dt == null)
            {
                return(list);
            }
            list = new List <Receipt>();
            Receipt receipt;

            foreach (DataRow row in dt.Rows)
            {
                receipt = new Receipt();

                /*
                 * tianzhenyun
                 * 2013-11-18   update
                 * 根据客户要求如果是直销,终端上的发货单列表显示发票号(即零售日报号)
                 * **/
                receipt.Code = Cast.ToString(row["cDLCode"]);
                //判断发票号是否空,如果为空则显示发货单号,否则为发票号(即零售日报号)
                receipt.ShowCode = string.IsNullOrEmpty(Cast.ToString(row["cSBVCode"])) ? Cast.ToString(row["cDLCode"]) : Cast.ToString(row["cSBVCode"]); //采购到货单号
                receipt.dDate    = Cast.ToDateTime(row["dDate"]);                                                                                         //日期
                receipt.Name     = Cast.ToString(row["cCusAbbName"]);                                                                                     //供应商
                list.Add(receipt);
            }
            return(list);
        }
Esempio n. 6
0
        /// <summary>
        /// 销售出库:新增单据
        /// </summary>
        /// <param name="rdRecord"></param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public bool Save(RdRecord rdRecord, out string errMsg)
        {
            BLL.Service.RdRecord tRdRecord = new BLL.Service.RdRecord();
            //主表转换
            EntityConvert.ConvertClass <RdRecord, BLL.Service.RdRecord>(rdRecord, tRdRecord);

            //循环遍历子表
            BLL.Service.RdRecords tRdRecords;
            //初始化目标数组
            tRdRecord.List = new BLL.Service.RdRecords[rdRecord.List.Count];
            int i = 0;

            foreach (RdRecords rdRecords in rdRecord.List)
            {
                tRdRecords = new BLL.Service.RdRecords();
                EntityConvert.ConvertClass <RdRecords, BLL.Service.RdRecords>(rdRecords, tRdRecords);
                tRdRecords.SerialList = rdRecords.SerialList.ToArray();//标签序列号集合
                tRdRecord.List[i++]   = tRdRecords;
            }

            return(Common.Instance.Service.ST_SaleOut_Save(Common.Instance.User, tRdRecord, out errMsg));
        }