Ejemplo n.º 1
0
Archivo: LoginDA.cs Proyecto: SHKCB/RF
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public static UserViewEntity Login(ref UserViewEntity entity)
        {
            SCM.RF.Server.Adapt.IWebWarehouseServiceQYBService service = new Adapt.IWebWarehouseServiceQYBService();

            string param = @"<?xml version='1.0' encoding='UTF-8'?>
                                <rt>
                                <tid>" + entity.TID + @"</tid>
                                <uname>" + entity.UName + @"</uname>
                                <pwd>" + entity.PWD + @"</pwd>
                                <device>" + entity.Device + @"</device>
                                <cid>" + entity.CID + @"</cid>
                                </rt>";

            string result = service.login(param);

            /*
             *  <?xml version="1.0" encoding="UTF-8"?>
             *  <rt>
             *  <tid>20160112161900199</tid>
             *  <warehouseid>47a7377d4a9e42e3a665af0894946e21</warehouseid>
             *  <rc>0000</rc>
             *  <rm>成功</rm>
             *  </rt>
             */

            XmlDocument xml = new XmlDocument();

            xml.LoadXml(result);

            string returncode = xml.SelectSingleNode("rt/rc").InnerText;

            if (returncode == "0000")
            {
                entity.WareHouseId = xml.SelectSingleNode("rt/warehouseid").InnerText;
                entity.Success     = true;
                entity.IsLoggedIn  = true;
            }
            else
            {
                entity.Success    = false;
                entity.Message    = xml.SelectSingleNode("rt/rm").InnerText;
                entity.IsLoggedIn = false;
            }

            return(entity);
        }
Ejemplo n.º 2
0
        public static ReceiveDetailViewEntity GetGoodsUnitInfos(ref ReceiveDetailViewEntity entity)
        {
            SCM.RF.Server.Adapt.IWebWarehouseServiceQYBService service = new Adapt.IWebWarehouseServiceQYBService();

            string param = @"<?xml version='1.0' encoding='UTF-8'?>
                                <rt>
                                <tid>" + entity.TID + @"</tid>
                                <uname>" + entity.UName + @"</uname>
                                <pwd>" + entity.PWD + @"</pwd>
                                <cid>" + entity.CID + @"</cid>        
                                <warehouseid>" + entity.WareHouseId + @"</warehouseid>                             
                                <goodsid>" + entity.Goodsid + @"</goodsid>
                            </rt>";

            string xmlstring = service.getInstockDetail(param);

            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xmlstring);

            return(entity);
        }
Ejemplo n.º 3
0
Archivo: LoginDA.cs Proyecto: SHKCB/RF
        /// <summary>
        /// 退出系统
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public static int LointOut(ref UserViewEntity entity)
        {
            SCM.RF.Server.Adapt.IWebWarehouseServiceQYBService service = new Adapt.IWebWarehouseServiceQYBService();

            string param = @"<?xml version='1.0' encoding='UTF-8'?>
                                <rt>
                                <tid>" + entity.TID + @"</tid>
                                <uname>" + entity.UName + @"</uname>
                                <pwd>" + entity.PWD + @"</pwd>
                                <device>" + entity.Device + @"</device>
                                <cid>" + entity.CID + @"</cid>
                                </rt>";

            string result = service.loginout(param);

            if (result.IndexOf("<rc>0000</rc>") >= 0)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
Ejemplo n.º 4
0
        public static PickEnity GetPickByTaskID(ref PickEnity entity)
        {
            SCM.RF.Server.Adapt.IWebWarehouseServiceQYBService service = new Adapt.IWebWarehouseServiceQYBService();

            /*
             * <?xml version="1.0" encoding=“UTF-8”?>
             * <rt>
             * <tid>20140318155513001</tid>
             * <uname>009933</uname>
             * <pwd>1</pwd>
             * <cid>665731</cid>
             * <code></code>
             * </rt>
             *
             */

            string param = @"<?xml version='1.0' encoding='UTF-8'?><rt><tid>" + entity.TID + @"</tid><uname>" + entity.UName + @"</uname><pwd>" + entity.PWD + @"</pwd><device>" + entity.Device + @"</device><cid>" + entity.CID + @"</cid><warehouseid>" + entity.WareHouseId + @"</warehouseid><code>" + entity.TaskNo + @"</code></rt>";

            string result = service.getJhOutstockById(param);

            XmlDocument xml = new XmlDocument();

            xml.LoadXml(result);

            string returncode = xml.SelectSingleNode("rt/rc").InnerText;

            if (returncode == "0000")
            {
                #region 获取订单号列表
                XmlNodeList nodeList           = xml.SelectNodes("rt/jhoutstocks/outstock");
                List <OrderMasterEntity> list1 = null;
                List <OrderItemEntity>   list2 = null;
                StringBuilder            sb    = new StringBuilder();
                sb.Append("<?xml version='1.0' encoding='UTF-8'?>");
                sb.Append("<rt><tid>" + entity.TID + @"</tid><uname>" + entity.UName + @"</uname><pwd>" + entity.PWD + @"</pwd><device>" + entity.Device + @"</device><cid>" + entity.CID + @"</cid><warehouseid>" + entity.WareHouseId + @"</warehouseid>");
                sb.Append("<id>");

                OrderMasterEntity orderMaster = null;

                list1 = new List <OrderMasterEntity>(nodeList.Count);

                foreach (XmlNode node in nodeList)
                {
                    orderMaster = new OrderMasterEntity();
                    orderMaster.dispatchcode = node.SelectSingleNode("dispatchcode").InnerText;
                    orderMaster.id           = node.SelectSingleNode("id").InnerText;
                    orderMaster.num          = node.SelectSingleNode("num").InnerText;
                    orderMaster.ordercode    = node.SelectSingleNode("ordercode").InnerText;
                    orderMaster.taskid       = node.SelectSingleNode("taskid").InnerText;
                    orderMaster.tousername   = node.SelectSingleNode("tousername").InnerText;
                    list1.Add(orderMaster);

                    sb.Append("<outstockid>" + orderMaster.id + "</outstockid>");
                }

                sb.Append("</id></rt>");
                #endregion

                #region 通过订单号列表获取商品明细

                result = service.getTaskDByIds(sb.ToString());

                xml.LoadXml(result);

                returncode = xml.SelectSingleNode("rt/rc").InnerText;

                if (returncode == "0000")
                {
                    nodeList = xml.SelectNodes("rt/taskds/taskd");

                    OrderItemEntity orderItem = null;

                    list2 = new List <OrderItemEntity>(nodeList.Count);

                    foreach (XmlNode node in nodeList)
                    {
                        orderItem              = new OrderItemEntity();
                        orderItem.amount       = node.SelectSingleNode("amount").InnerText;
                        orderItem.cbarcode     = node.SelectSingleNode("cbarcode").InnerText;
                        orderItem.doneamount   = node.SelectSingleNode("doneamount").InnerText;
                        orderItem.fromitemcode = node.SelectSingleNode("fromitemcode").InnerText;
                        orderItem.num          = node.SelectSingleNode("num").InnerText;
                        orderItem.outerid      = node.SelectSingleNode("outerid").InnerText;
                        orderItem.shortname    = node.SelectSingleNode("shortname").InnerText;
                        orderItem.taskdid      = node.SelectSingleNode("taskdid").InnerText;
                        orderItem.taskid       = node.SelectSingleNode("taskid").InnerText;

                        list2.Add(orderItem);
                    }
                }

                #endregion

                entity.OrderMasterList = list1.ToArray();
                entity.OrderItemList   = list2.ToArray();

                entity.Success = true;
            }
            else
            {
                entity.Success = false;
                entity.Message = xml.SelectSingleNode("rt/rm").InnerText;
            }

            return(entity);
        }
Ejemplo n.º 5
0
        public static ReceiveHeaderViewEntity GetReceiveDetail(ref ReceiveHeaderViewEntity entity)
        {
            SCM.RF.Server.Adapt.IWebWarehouseServiceQYBService service = new Adapt.IWebWarehouseServiceQYBService();

            string param = @"<?xml version='1.0' encoding='UTF-8'?>
                                <rt>
                                <tid>" + entity.TID + @"</tid>
                                <uname>" + entity.UName + @"</uname>
                                <pwd>" + entity.PWD + @"</pwd>
                                <cid>" + entity.CID + @"</cid>
                                <warehouseid>" + entity.WareHouseId + @"</warehouseid>
                                <fromcode>" + entity.Instockcode + @"</fromcode>
                            </rt>";

            string xmlstring = service.getInstockDetail(param);

            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xmlstring);

            /*
             * <?xml version="1.0" encoding="UTF-8"?>
             * <rt>
             * <tid>20160113105010820</tid>
             * <warehouseid>47a7377d4a9e42e3a665af0894946e21</warehouseid>
             * <rc>0000</rc>
             * <rm>�ɹ�</rm>
             * <instockdetails>
             *  <instockdetail>
             *    <outerid>MJ4-01A</outerid>
             *    <pres>��</pres>
             *    <cbarcode>MJ4-01A</cbarcode>
             *    <planamount>5</planamount>
             *    <waitamount>5</waitamount>
             *    <waittxj>0/0/5</waittxj>
             *    <plantxj>0/0/5</plantxj>
             *    <param1></param1>
             *    <param2></param2>
             *    <param3></param3>
             *    <param4></param4>
             *    <param5></param5>
             *    <param6></param6>
             *    <param7></param7>
             *    <param8></param8>
             *    <gname>���׷�������ħ��4�� �����۾� 3D������ʵ�۾�VR�۾��ֻ�ͷ�� ��׿��</gname>
             *    <goodsid>53d500e9df8b4ec1a69808d09c72b378</goodsid>
             *    <stockstatus>ZC</stockstatus>
             *    <inserial>false</inserial>
             *    <instockid>e2358a9891144cdc92da9692ec26dcf0</instockid>
             *    <instockdetailid>525f6676f6c443d3ae9866f5e0d9350d</instockdetailid>
             *    <instockrule>7607ad5822ff485bb7e272810e6a74e2</instockrule>
             *  </instockdetail>
             * </instockdetails>
             * </rt>
             */

            string returncode = doc.SelectSingleNode("rt/rc").InnerText;

            if (returncode == "0000")
            {
                XmlNodeList detail = doc.SelectNodes("rt/instockdetails/instockdetail");

                entity.Detail = new ReceiveDetailViewEntity[detail.Count];

                ReceiveDetailViewEntity detailitem;

                for (int i = 0; i < detail.Count; i++)
                {
                    detailitem = new ReceiveDetailViewEntity();

                    detailitem = new SCM.RF.Server.Utility.XmlHelper <ReceiveDetailViewEntity>().GetEntityByNode(detailitem, detail[i]);

                    entity.Detail[i] = detailitem;
                }

                entity.Success = true;
            }
            else
            {
                entity.Success = false;
                entity.Message = doc.SelectSingleNode("rt/rm").InnerText;
            }

            return(entity);
        }