Esempio n. 1
0
        private void CopySPInfoToZC(string bid, string spid)
        {
            List <SearchField> list1 = new List <SearchField>();

            list1.Add(new SearchField("id", spid, SearchFieldType.数值型));
            Hashtable ht = this.tabCommand.SearchData(list1);

            ht.Remove("bid");

            U_ZCBAOBU zcb1 = new U_ZCBAOBU();
            string    ids  = zcb1.GetZCIDByBID(bid);

            zcb1.Close();
            string[] str = ids.Split(',');
            U_ZCBU   zc1 = new U_ZCBU();

            this.tabCommand.TabName = "U_ZCSP";
            for (int i = 0; i < str.Length; i++)
            {
                if (zc1.GetCurrentZcCZbyID1(str[i]) != null)
                {
                    string czid = zc1.GetCurrentZcCZbyID1(str[i])["zcczid"].ToString();
                    ht["zcid"]    = str[i];
                    ht["czid"]    = czid;
                    ht["PSCount"] = "0";
                    this.tabCommand.InsertData(ht);
                }
            }

            this.tabCommand.TabName = TabName;
        }
Esempio n. 2
0
        //将信息复制到所有的资产
        public bool CopyZcBCzczfstoZc(string bid, string id)
        {
            this.tabCommand.TableConnect.BeginTrans();
            try
            {
                this.tabCommand.TabName = "U_ZCBAOInfo";
                List <SearchField> list1 = new List <SearchField>();
                list1.Add(new SearchField("bid", bid, SearchFieldType.数值型));
                DataSet ds  = this.tabCommand.SearchData("*", list1);
                string  ids = "";
                if (ds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            ids = ds.Tables[0].Rows[i]["zcid"].ToString();
                        }
                        else
                        {
                            ids = ids + "," + ds.Tables[0].Rows[i]["zcid"].ToString();
                        }
                    }
                }
                this.tabCommand.TabName = "U_ZCB21";
                List <SearchField> list2 = new List <SearchField>();
                list2.Add(new SearchField("id", id, SearchFieldType.数值型));
                Hashtable ht = this.tabCommand.SearchData(list2);
                ht.Remove("id");
                ht.Remove("bid");

                this.tabCommand.TabName = "U_ZC21";

                U_ZCBU zc1 = new U_ZCBU();
                if (ids != "")
                {
                    string[] str = ids.Split(',');
                    for (int i = 0; i < str.Length; i++)
                    {
                        ht["czid"] = zc1.GetCurrentZcCZbyID1(str[i])["zcczid"];

                        ht["zcid"] = str[i];
                        this.tabCommand.InsertData(ht);
                    }
                }
                zc1.Close();
                this.tabCommand.TabName = TabName;
                this.tabCommand.TableConnect.CommitTrans();
                return(true);
            }
            catch (Exception err1)
            {
                this.tabCommand.TableConnect.RollBackTrans();
                return(false);
            }
        }