Ejemplo 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;
        }
Ejemplo n.º 2
0
        //将信息复制到所有的资产
        public bool CopyZcTctoZc(string bid, string id, string wz)
        {
            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 = TabName;
                List <SearchField> list2 = new List <SearchField>();
                list2.Add(new SearchField("id", id, SearchFieldType.数值型));
                Hashtable ht = this.tabCommand.SearchData(list2);
                ht.Remove("id");
                if (ids != "")
                {
                    string[] str = ids.Split(',');
                    for (int i = 0; i < str.Length; i++)
                    {
                        U_ZCBU zc1 = new U_ZCBU();
                        ht["zeren"] = zc1.GetZerenByZCID(str[i]);
                        ht["zcid"]  = str[i];
                        ht["bkind"] = "0";
                        this.tabCommand.InsertData(ht);
                    }
                }



                U_ZCBAOBU zcb1 = new U_ZCBAOBU();
                zcb1.UpdateZcstatus(bid, ht["kind"].ToString(), wz);
                zcb1.Close();

                this.tabCommand.TableConnect.CommitTrans();
                return(true);
            }
            catch (Exception err1)
            {
                this.tabCommand.TableConnect.RollBackTrans();
                return(false);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 核心方法2-资产批阅方法
        /// </summary>
        /// <param name="zeren">责任人</param>
        /// <param name="czid">资产处置申报Id</param>
        /// <param name="sp1">处置流程</param>
        /// <returns></returns>
        private string SendSPPerson(string zeren, string czid, SP sp1)
        {
            string[] Person1 = zeren.Split(',');
            string   bid     = null; //资产的ID

            //根据资产处置ID得到资产ID
            List <SearchField> list1 = new List <SearchField>();

            list1.Add(new SearchField("id", czid, SearchFieldType.数值型));
            this.tabCommand.TabName = "U_ZCB2";
            Hashtable ht0 = this.tabCommand.SearchData(list1);

            bid = ht0["bid"].ToString();

            U_ZCBAOBU zc1 = new U_ZCBAOBU();

            zc1.UpdateZcstatus(bid, ((int)sp1).ToString().PadLeft(2, '0'), "0");
            zc1.Close();

            this.tabCommand.TabName = TabName;
            string result = null;

            try
            {
                Hashtable ht1 = new Hashtable();
                ht1["bid"]   = bid;
                ht1["czid"]  = czid;
                ht1["zeren"] = Person1;
                ht1["kind"]  = ((int)sp1).ToString().PadLeft(2, '0');
                this.SaveSP(ht1);

                ////发送电子邮件
                //ZX_Email1BU em1 = new ZX_Email1BU();
                //for (int i = 0; i < Person1.Length; i++)
                //{
                //    em1.SendToZcGL(Person1[i], "有需要你审批的资产包,请注意及时审批!");
                //}
                //em1.Close();
            }
            catch
            {
                result = "提示:操作失败,请重新提交审批!";
            }
            return(result);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 核心方法1-批阅资产(调用时,必须起用事务)
        /// </summary>
        /// <param name="spid"></param>
        /// <param name="ht"></param>
        /// <returns></returns>
        private string PiYue(string spid, Hashtable ht)
        {
            string             zcspstatus = "";
            string             czid       = "";
            List <SearchField> list1      = new List <SearchField>();

            //修改批阅数据中的相关信息
            list1.Add(new SearchField("id", spid, SearchFieldType.数值型));
            DataSet ds1 = this.tabCommand.SearchData("*", list1);

            czid = ds1.Tables[0].Rows[0]["czid"].ToString();
            if (ds1.Tables[0].Rows.Count > 0)
            {
                foreach (DictionaryEntry item in ht)
                {
                    ds1.Tables[0].Rows[0][item.Key.ToString()] = item.Value;
                }
                this.tabCommand.Update(ds1);
            }

            //修改资产中相关的数据
            int NewStatus = 0;                      //表示资产调整后的状态;

            list1.Clear();
            string bid = ds1.Tables[0].Rows[0]["bID"].ToString();

            this.tabCommand.TabName = "U_ZCBAO";
            list1.Add(new SearchField("id", bid, SearchFieldType.数值型));
            DataSet ds2 = this.tabCommand.SearchData("id,bstatus", list1);

            if (ds2.Tables[0].Rows.Count > 0)
            {
                int curStatus = Int32.Parse(ds2.Tables[0].Rows[0]["bstatus"].ToString());//表示资产的当前状态;
                NewStatus = curStatus;

                SP curSP = (SP)curStatus;                             //资产当前状态的枚举值
                if (curStatus == 4)
                {
                    curStatus = 10;
                }
                int NextStatus  = curStatus + 1;     //表示资产的下一个状态
                int BeginStatus = (int)SP.开始审批;      //表示资产审批的开始状态


                //处理审核委员会和决策委员会主席的情况
                U_RolesBU role1   = new U_RolesBU();
                string    zxname1 = role1.GetRoleAllUsers("审核委员会主席");
                bool      zx1     = false;
                if (ht["zeren"].ToString() == zxname1)
                {
                    zx1 = true;
                }
                string zxname2 = role1.GetRoleAllUsers("决策委员会主席");
                bool   zx2     = false;
                if (ht["zeren"].ToString() == zxname2)
                {
                    zx2 = true;
                }
                role1.Close();


                //根据资产的当前状况进行不同的处理
                if (ht["ps"].ToString() == "不同意")
                {
                    if (curSP == SP.部门审批 ||
                        (curSP == SP.审核委员会审批 && zx1) ||
                        (curSP == SP.决策委员会审批 && zx2)
                        )
                    {
                        NewStatus = BeginStatus;    //回到原来的状态
                    }
                }
                else if (ht["ps"].ToString() == "同意")
                {
                    if (curSP == SP.部门审批 ||
                        curSP == SP.机要室编号 ||
                        (curSP == SP.审核委员会审批 && zx1) ||
                        (curSP == SP.决策委员会审批 && zx2)
                        )
                    {
                        NewStatus = curStatus + 1;    //前进到下一个状态
                    }
                }
                else
                {
                    if (curSP == SP.审核委员会审批 && zx1)
                    {
                        NewStatus = curStatus + 1;    //前进到"决策委员会审批"
                    }
                }
                string sp1 = NewStatus + "";
                ds2.Tables[0].Rows[0]["bstatus"] = sp1.PadLeft(2, '0');
                this.tabCommand.Update(ds2);
            }

            this.tabCommand.TabName = TabName;
            //修改资产审批的状态
            zcspstatus = NewStatus + "";
            zcspstatus = zcspstatus.PadLeft(2, '0');
            list1.Clear();
            if (bid != "" && zcspstatus != "")
            {
                this.tabCommand.TabName = "U_ZCB2";
                list1.Add(new SearchField("id", czid, SearchFieldType.数值型));
                Hashtable ht0 = new Hashtable();
                ht0["status"] = zcspstatus;
                this.tabCommand.EditQuickData(list1, ht0);
                this.tabCommand.TabName = TabName;
            }

            U_ZCBAOBU zc1 = new U_ZCBAOBU();

            zc1.UpdateZcstatus(bid, zcspstatus, "0");
            zc1.Close();

            return(czid);
        }