Пример #1
0
        public string TestAddPart(string ponum, string oastatus, string oaresult)
        {
            string sr = "";

            try
            {
                Session   epicorSession = createSession();
                POImpl    poAdapter     = Ice.Lib.Framework.WCFServiceSupport.CreateImpl <POImpl>(epicorSession, Epicor.ServiceModel.Channels.ImplBase <POSvcContract> .UriPath);//
                PODataSet pods          = poAdapter.GetByID(int.Parse(ponum));

                string echo = string.Format("OA03: {0} OA05:{1}", pods.POHeader.Rows[0]["OA03_c"], pods.POHeader.Rows[0]["OA05_c"]);
                //lb_log.Items.Add("count: " + pods.POHeader.Rows.Count);
                //lb_log.Items.Add(echo);
                //foreach (DataColumn col in pods.POHeader.Columns)
                //{
                //    lb_log.Items.Add(string.Format("colname: {0} colvalue: {1}", col.ColumnName, pods.POHeader.Rows[0][col.ColumnName]));
                //}
                pods.POHeader.Rows[0]["OA03_c"] = oastatus;
                pods.POHeader.Rows[0]["OA02_c"] = oaresult;
                if (oastatus.Equals('Y'))
                {
                    pods.POHeader.Rows[0]["Approve"] = true;
                }
                else
                {
                    pods.POHeader.Rows[0]["Approve"] = false;
                }
                //PartImplpartAdapter = Ice.Lib.Framework.WCFServiceSupport.CreateImpl<PartImpl>(epicorSession, Epicor.ServiceModel.Channels.ImplBase<PartSvcContract>.UriPath);
                //string partnum = "TestPartAdd";
                //PartDataSetds = new PartDataSet();
                //partAdapter.GetNewPart(ds);
                //ds.Tables[0].Rows[0]["PartNum"] = partnum;
                //ds.Tables[0].Rows[0]["PartDescription"] = partnum;
                //partAdapter.ChangePartNum(partnum, ds);
                //partAdapter.Update(ds);
                poAdapter.Update(pods);
                closeSession();
                sr = "OK";
            }
            catch (Exception ex)
            {
                sr = ex.Message.ToString();
            }

            return(sr);
        }
Пример #2
0
        public string TestAddPart()
        {
            string    userName      = "******";
            string    passWord      = "******";
            string    appServerUrl  = "net.tcp://epicor-ser/ERP102300";                                                                                                       // "net.tcp://192.168.6.25/ERP102300";//net.tcp://epicor-ser/ERP102300
            Session   epicorSession = new Session(userName, passWord, appServerUrl, Ice.Core.Session.LicenseType.Default, @"C:\Epicor\ERP10\LocalClients\ERP102300\config\ERP102300.sysconfig", false, "ONOFF01", null);
            POImpl    poAdapter     = Ice.Lib.Framework.WCFServiceSupport.CreateImpl <POImpl>(epicorSession, Epicor.ServiceModel.Channels.ImplBase <POSvcContract> .UriPath); //
            PODataSet pods          = poAdapter.GetByID(int.Parse(txt_ponum.Text));

            string echo = string.Format("OA03: {0} OA05:{1}", pods.POHeader.Rows[0]["OA03_c"], pods.POHeader.Rows[0]["OA05_c"]);

            lb_log.Items.Add("count: " + pods.POHeader.Rows.Count);
            lb_log.Items.Add(echo);
            foreach (DataColumn col in pods.POHeader.Columns)
            {
                lb_log.Items.Add(string.Format("colname: {0} colvalue: {1}", col.ColumnName, pods.POHeader.Rows[0][col.ColumnName]));
            }

            lb_log.Items.Add("Podetail count: " + pods.PODetail.Rows.Count);

            foreach (PODetailRow dr in pods.PODetail.Rows)
            {
                foreach (DataColumn col in pods.PODetail.Columns)
                {
                    lb_log.Items.Add(string.Format("colname: {0} colvalue: {1}", col.ColumnName, dr[col.ColumnName]));
                }
            }


            pods.POHeader.Rows[0]["OA05_c"] = "Y";
            pods.POHeader.Rows[0]["OA03_c"] = "Test";
            //PartImplpartAdapter = Ice.Lib.Framework.WCFServiceSupport.CreateImpl<PartImpl>(epicorSession, Epicor.ServiceModel.Channels.ImplBase<PartSvcContract>.UriPath);
            //string partnum = "TestPartAdd";
            //PartDataSetds = new PartDataSet();
            //partAdapter.GetNewPart(ds);
            //ds.Tables[0].Rows[0]["PartNum"] = partnum;
            //ds.Tables[0].Rows[0]["PartDescription"] = partnum;
            //partAdapter.ChangePartNum(partnum, ds);
            //partAdapter.Update(ds);
            poAdapter.Update(pods);
            epicorSession.Dispose();
            return("");
        }