Beispiel #1
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);
            }
        }
Beispiel #2
0
    //设置页面信息
    private void BindData()
    {
        if (Request["id"] != null)
        {
            string zcid = Request["id"].ToString();
            U_ZCBU zc1  = new U_ZCBU();

            DataSet ds    = zc1.GetZCSSInfo(zcid);
            string  user1 = zc1.GetZerenByZCID(zcid);
            zc1.Close();
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < arr1.Length; i++)
                {
                    Util.SetControlValue(this.sszt.Parent.FindControl(arr1[i]), ds.Tables[0].Rows[0][arr1[i]]);
                    Util.SetControlValue(this.sszt.Parent.FindControl(arr1[i] + "_1"), ds.Tables[0].Rows[0][arr1[i]]);
                }
            }
            ds.Dispose();


            //设置按钮的权限
            if (user1 == User.Identity.Name || (user1.Trim() == "" && PubComm.IsRole("系统管理员")))
            {
                this.Button1.Visible = true;

                for (int i = 0; i < arr1.Length; i++)
                {
                    if (this.sszl.Parent.FindControl(arr1[i] + "_1") != null)
                    {
                        this.sszl.Parent.FindControl(arr1[i] + "_1").Visible = false;
                    }
                }
            }
            else
            {
                this.Button1.Visible = false;

                for (int i = 0; i < arr1.Length; i++)
                {
                    if (this.sszl.Parent.FindControl(arr1[i]) != null)
                    {
                        this.sszl.Parent.FindControl(arr1[i]).Visible = false;
                    }
                }
            }
        }
    }
Beispiel #3
0
 //控制【抵押物】和【质押物】的编辑和修改
 protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.FindControl("butDel") != null)
     {
         if (Request["id"] != null)
         {
             string     zcid  = Request["id"].ToString();
             U_ZCBU     zc1   = new U_ZCBU();
             string     user1 = zc1.GetZerenByZCID(zcid);
             LinkButton but1  = e.Item.FindControl("butDel") as LinkButton;
             LinkButton but2  = e.Item.FindControl("butEdit") as LinkButton;
             if (user1 != User.Identity.Name)
             {
                 but1.Visible = false;
                 but2.Visible = false;
             }
         }
     }
 }
Beispiel #4
0
    private void BindData()
    {
        if (Request["id"] != null)
        {
            string  zcid  = Request["id"].ToString();
            U_ZCBU  zc1   = new U_ZCBU();
            DataSet ds    = zc1.GetZCDBInfoByID(zcid);
            string  user1 = zc1.GetZerenByZCID(zcid);
            zc1.Close();
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < arr1.Length; i++)
                {
                    Util.SetControlValue(this.bzyx.Parent.FindControl(arr1[i]), ds.Tables[0].Rows[0][arr1[i]]);
                    Util.SetControlValue(this.bzyx.Parent.FindControl(arr1[i] + "_1"), ds.Tables[0].Rows[0][arr1[i]]);
                }
                if (ds.Tables[0].Rows[0]["hssj"] != DBNull.Value)
                {
                    string dt = DateTime.Parse(ds.Tables[0].Rows[0]["hssj"].ToString()).ToString("yyyy-MM-dd");
                    Util.SetControlValue(this.bzyx.Parent.FindControl("hssj"), dt);
                    Util.SetControlValue(this.bzyx.Parent.FindControl("hssj_1"), dt);
                }
            }
            ds.Dispose();


            //设置按钮的权限
            if (user1 == User.Identity.Name || (user1.Trim() == "" && Comm.IsRole("系统管理员")))
            {
                this.Button1.Visible = true;
                this.Adddyw.Visible  = true;
                this.Addzyw.Visible  = true;

                for (int i = 0; i < arr1.Length; i++)
                {
                    if (this.bzyx.Parent.FindControl(arr1[i] + "_1") != null)
                    {
                        this.bzyx.Parent.FindControl(arr1[i] + "_1").Visible = false;
                    }
                }
            }
            else
            {
                this.Button1.Visible = false;
                this.Adddyw.Visible  = false;
                this.Addzyw.Visible  = false;

                for (int i = 0; i < arr1.Length; i++)
                {
                    if (this.bzyx.Parent.FindControl(arr1[i]) != null)
                    {
                        this.bzyx.Parent.FindControl(arr1[i]).Visible = false;
                    }
                }
            }

            if (Comm.IsRole("系统管理员"))
            {
                this.Button2.Visible = true;
            }
            else
            {
                this.Button2.Visible = false;
            }

            //设置数字金额的显示
            string[] num1 = new string[] { "zwrhsgz", "bzrhsgz", "qthsgz", "bzje", "klazfy", "dyhsgz1", "dyhsgz2" };
            for (int i = 0; i < num1.Length; i++)
            {
                TextBox t1 = this.zwrhsgz.Parent.FindControl(num1[i]) as TextBox;
                Label   l1 = this.zwrhsgz.Parent.FindControl(num1[i] + "_1") as Label;
                if (t1 != null)
                {
                    t1.Text = Comm.GetNumberFormat(t1.Text);
                }
                if (l1 != null)
                {
                    l1.Text = Comm.GetNumberFormat(l1.Text);
                }
            }
        }
    }