Пример #1
0
    private void SetPageData()
    {
        if (Request["tcid"] != null)
        {
            U_ZCTimeBU time1 = new U_ZCTimeBU();
            Hashtable  ht    = time1.GetTimeDataByID(Request["tcid"]);
            time1.Close();
            if (ht.Count > 0)
            {
                foreach (string item in arr1)
                {
                    Util.SetControlValue(this.timename.Parent.FindControl(item), ht[item]);
                }
            }
            if (this.time0.Text != "" && this.time0.Text != null)
            {
                this.time0.Text = DateTime.Parse(this.time0.Text).ToString("yyyy-M-d");
            }

            string  sName = "";
            string  zcid  = ht["zcid"].ToString();
            U_ZCBU  zc1   = new U_ZCBU();
            DataSet ds2   = zc1.GetDetailByID(zcid);
            if (ds2.Tables[0].Rows.Count > 0)
            {
                sName = ds2.Tables[0].Rows[0]["danwei"].ToString();
            }
            zc1.Close();
            this.hidCorp.Value      = sName;
            this.HiddenField1.Value = ht["zcid"].ToString();
        }
    }
Пример #2
0
    private void BindData(U_ZCFilesBU file1)
    {
        bool flag = false;

        if (file1 == null)
        {
            file1 = new U_ZCFilesBU();
            flag  = true;
        }
        DataSet ds1 = file1.GetAttachListByZCID(Request["id"].ToString());

        this.Repeater1.DataSource = ds1;
        this.Repeater1.DataBind();

        string  id  = Request["id"];
        U_ZCBU  zc1 = new U_ZCBU();
        DataSet ds  = zc1.GetDetailByID(id, "depart,zeren,danwei");

        zc1.Close();
        if (ds.Tables[0].Rows.Count > 0)
        {
            this.danwei.Text = ds.Tables[0].Rows[0]["danwei"].ToString();
            this.depart.Text = ds.Tables[0].Rows[0]["depart"].ToString();
            this.zeren.Text  = ds.Tables[0].Rows[0]["zeren"].ToString();
        }
        if (flag)
        {
            file1.Close();
        }
    }
Пример #3
0
    private void BindData()
    {
        if (Request["zcid"] != null)
        {
            string  id  = Request["zcid"];
            U_ZCBU  zc1 = new U_ZCBU();
            string  fs  = "danwei,depart,zeren,bj,lx,pbj,plx,fee1,fee2,fee3,fee4,fee5,fee6,fee7,fee8,fee9,fee10,fee11,fee12,bjye,lxye,hbxh,bxhjye,fyhj";
            DataSet ds  = zc1.GetDetailByID(id, "danwei,depart,zeren,bj,pbj,plx,fee1,fee2,fee3,fee4,fee5,fee6,fee7,fee8,fee9,fee10,fee11,fee12,isnull(bj,0)-isnull(pbj,0) as bjye ,isnull(lx1,0)+isnull(lx2,0)+isnull(lx3,0)-plx as lxye,isnull(pbj,0)+isnull(plx,0) as hbxh,isnull(bj,0)+isnull(lx1,0)+isnull(lx2,0)+isnull(lx3,0)-isnull(pbj,0)-isnull(plx,0) as bxhjye,isnull(fee1,0)+isnull(fee2,0)+isnull(fee3,0)+isnull(fee4,0)+isnull(fee5,0)+isnull(fee6,0)+isnull(fee7,0)+isnull(fee8,0)+isnull(fee9,0)+isnull(fee10,0)+isnull(fee11,0)+isnull(fee12,0)+isnull(fee13,0)+isnull(fee14,0)+isnull(fee15,0)+isnull(fee16,0)+isnull(fee17,0)+isnull(fee18,0)+isnull(fee19,0)+isnull(fee20,0) as fyhj,isnull(lx1,0)+isnull(lx2,0)+isnull(lx3,0) as lx");
            zc1.Close();
            string[] AF = fs.Split(',');
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < AF.Length; i++)
                {
                    Util.SetControlValue(this.pbj.Parent.FindControl(AF[i]), ds.Tables[0].Rows[0][AF[i]]);
                }
            }
            //设置数字金额的显示
            string[] num1 = new string[] { "pbj", "plx", "fee1", "fee2", "fee3", "fee4", "fee5", "fee6", "fee7", "fee8", "fee9", "fee10", "fee11", "fee12", "bjye", "lxye", "hbxh", "bxhjye", "fyhj" };
            for (int i = 0; i < num1.Length; i++)
            {
                Label l1 = this.pbj.Parent.FindControl(num1[i]) as Label;
                if (l1 != null)
                {
                    l1.Text = Comm.GetNumberFormat(l1.Text);
                }
            }

            ds.Dispose();
        }
    }
Пример #4
0
    private void BindList()
    {
        string  id  = Request.QueryString["id"];
        U_ZCBU  zc1 = new U_ZCBU();
        DataSet ds  = zc1.GetDetailByID(id, "danwei,depart,zeren");

        this.danwei.Text = ds.Tables[0].Rows[0]["danwei"].ToString();
        this.depart.Text = ds.Tables[0].Rows[0]["depart"].ToString();
        this.zeren.Text  = ds.Tables[0].Rows[0]["zeren"].ToString();
        zc1.Close();

        CW_StockBillBU stock1 = new CW_StockBillBU();

        this.Repeater1.DataSource = stock1.GetStockListByZcID1(id);
        this.Repeater1.DataBind();
        stock1.Close();

        ////////////////////////////////////////
        CW_ShouKuanBU      shoukuan1 = new CW_ShouKuanBU();
        List <SearchField> list1     = new List <SearchField>();

        list1.Add(new SearchField("zcid", Request.QueryString["id"], SearchFieldType.数值型));
        this.Repeater2.DataSource = shoukuan1.GetBillList("2", list1, true);
        this.Repeater2.DataBind();

        ////////////////////////////////////////////////////////////
        list1.Clear();
        list1.Add(new SearchField("zcid", Request.QueryString["id"], SearchFieldType.数值型));
        this.Repeater3.DataSource = shoukuan1.GetBillList("3", list1, true);
        this.Repeater3.DataBind();

        shoukuan1.Close();
    }
Пример #5
0
        //得到包内资产的本金合计
        public Hashtable GetZcBbjANDlx(string bid)
        {
            string ids = this.GetZCIDByBID(bid);

            string[] str   = ids.Split(',');
            double   bbjhj = 0;
            double   blxhj = 0;
            U_ZCBU   zc1   = new U_ZCBU();

            for (int i = 0; i < str.Length; i++)
            {
                DataSet ds = zc1.GetDetailByID(str[i]);
                if (ds.Tables[0].Rows[0]["bj"] != null && ds.Tables[0].Rows[0]["bj"].ToString() != "")
                {
                    string m = ds.Tables[0].Rows[0]["bj"].ToString();
                    bbjhj = bbjhj + Convert.ToDouble(m.Trim());
                }
                if (ds.Tables[0].Rows[0]["bxhj"] != null && ds.Tables[0].Rows[0]["bxhj"].ToString() != "")
                {
                    string n = ds.Tables[0].Rows[0]["bxhj"].ToString();
                    blxhj = blxhj + Convert.ToDouble(n.Trim());
                }
                ds.Dispose();
            }
            Hashtable ht = new Hashtable();

            ht["bbjhj"] = bbjhj.ToString();
            ht["blxhj"] = blxhj.ToString();
            return(ht);
        }
Пример #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.owner = Comm.IsZcMng(Request["zcid"], User.Identity.Name);
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["zcid"] != null)
            {
                string  id  = Request["zcid"];
                U_ZCBU  zc1 = new U_ZCBU();
                DataSet ds  = zc1.GetDetailByID(id, "*");
                zc1.Close();


                //////////////////////////////////////////////////////////////////////
                bool AttachFile = false;
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0][0] != DBNull.Value)
                    {
                        AttachFile             = true;
                        AttachFileName         = ds.Tables[0].Rows[0][0].ToString();
                        this.OldFileName.Value = AttachFileName;
                    }
                }

                if (owner == false)
                {
                    this.Row3.Visible = false;
                    this.Row1.Visible = false;
                    if (AttachFile == false)
                    {
                        Response.Write("<br><center>提示:资产负责人没有上传【不良资产逐户调查表!】<center>");
                        Response.End();
                    }
                }
                else
                {
                    if (AttachFile == false)
                    {
                        this.Row2.Visible = false;
                    }
                    else
                    {
                        this.Row1.Visible = false;
                    }
                }

                Page.DataBind();
            }
        }
    }
Пример #7
0
    private void BindData()
    {
        List <SearchField> list1 = (List <SearchField>)ViewState["SearchCondition"];
        U_ZCBU             zc1   = new U_ZCBU();

        DataSet ds1 = zc1.GetDetailByID(list1, "*,isnull(pbj,0)+isnull(plx,0) as hbxh,isnull(bj,0)+isnull(lx1,0)+isnull(lx2,0)+isnull(lx3,0) as bxh,isnull(fee1,0)+isnull(fee2,0)+isnull(fee3,0)+isnull(fee4,0)+isnull(fee5,0)+isnull(fee6,0)+isnull(fee7,0)+isnull(fee8,0)+isnull(fee9,0)+isnull(fee10,0)+isnull(fee11,0)+isnull(fee12,0)+isnull(fee13,0)+isnull(fee14,0)+isnull(fee15,0)+isnull(fee16,0)+isnull(fee17,0)+isnull(fee18,0)+isnull(fee19,0)+isnull(fee20,0) as fyhj");

        zc1.Close();

        this.hs.Text = ds1.Tables[0].Rows.Count.ToString();
        double bxh1  = 0;
        double bxh2  = 0;
        double hbxh1 = 0;
        double hbxh2 = 0;
        double fyhj  = 0;
        string id    = "";

        for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
        {
            if (ds1.Tables[0].Rows[i]["huobi"].ToString() == "美元")
            {
                bxh2  = bxh2 + double.Parse(ds1.Tables[0].Rows[i]["bxh"].ToString());
                hbxh2 = hbxh2 + double.Parse(ds1.Tables[0].Rows[i]["hbxh"].ToString());
            }
            else
            {
                bxh1  = bxh1 + double.Parse(ds1.Tables[0].Rows[i]["bxh"].ToString());
                hbxh1 = hbxh1 + double.Parse(ds1.Tables[0].Rows[i]["hbxh"].ToString());
            }


            fyhj = fyhj + double.Parse(ds1.Tables[0].Rows[i]["fyhj"].ToString());
            if (i == 0)
            {
                id = ds1.Tables[0].Rows[i]["id"].ToString();
            }
            else
            {
                id = id + "," + ds1.Tables[0].Rows[i]["id"].ToString();
            }
        }
        this.bxh1.Text  = PubComm.GetNumberFormat(bxh1.ToString()) + "元";
        this.bxh2.Text  = PubComm.GetNumberFormat(bxh2.ToString()) + "美元";
        this.hbxh1.Text = PubComm.GetNumberFormat(hbxh1.ToString()) + "元";
        this.hbxh2.Text = PubComm.GetNumberFormat(hbxh2.ToString()) + "美元";
        this.fyhj.Text  = PubComm.GetNumberFormat(fyhj.ToString()) + "元";
        ViewState["id"] = id;
    }
Пример #8
0
    //判断某用户对某资产是否有维护的权限
    public static bool IsZcMng(string zcid, string username)
    {
        bool    result = false;
        U_ZCBU  zc1    = new U_ZCBU();
        DataSet ds1    = zc1.GetDetailByID(zcid, "zeren");

        if (ds1.Tables[0].Rows.Count > 0)
        {
            if (ds1.Tables[0].Rows[0][0].ToString() == username)
            {
                result = true;
            }
        }
        zc1.Close();
        return(result);
    }
Пример #9
0
    //保存数据
    private void SaveData1()
    {
        if (Request["id"] != null)
        {
            U_ZCBU    zc3 = new U_ZCBU();
            DataSet   ds2 = zc3.GetDetailByID(Request["id"].ToString());
            Hashtable ht1 = new Hashtable();
            //foreach (string item in arr1)
            //{
            //    ht1[item] = ds2.Tables[0].Rows[0][item].ToString();
            //}
            //foreach (string item in arr2)
            //{
            //    ht1[item] = ds2.Tables[0].Rows[0][item].ToString();
            //}
            ht1["zcid"] = Request["id"].ToString();
            ht1["xgr"]  = User.Identity.Name;
            ht1["xgsj"] = DateTime.Now.ToString();
            zc3.InsertOldZC(ht1);
        }
        Hashtable ht = new Hashtable();

        //foreach (string item in arr1)
        //{
        //    ht[item] = Util.GetControlValue(this.zcbao.Parent.FindControl(item));
        //}
        //foreach (string item in arr2)
        //{
        //    ht[item] = Util.GetControlValue(this.zcbao.Parent.FindControl(item));
        //}
        ht.Remove("status");
        ht.Remove("zhuang");
        //提交数据保存
        try
        {
            U_ZCBU zc1 = new U_ZCBU();
            zc1.UpdateInfo(Request["id"], ht);
            zc1.Close();
            this.BindOldZCInfo();
            this.SetPageData();
            Util.alert(this.Page, "操作提示:更新资料成功!");
        }
        catch (Exception err1)
        {
            Util.alert(this.Page, "错误提示:更新资产数据失败,可能的原因是数据类型有错误,请检查【转入时间】日期,【本金利息】等为数值型后重新输入!");
        }
    }
Пример #10
0
    private void BindData()
    {
        if (Request["id"] != null)
        {
            U_ZCTimeBU time1 = new U_ZCTimeBU();
            DataSet    ds1   = time1.GetTimeListByParentID(Request["id"]);
            this.Repeater1.DataSource = ds1;
            this.Repeater1.DataBind();
            time1.Close();
            ds1.Dispose();

            string  id  = Request["id"];
            U_ZCBU  zc1 = new U_ZCBU();
            DataSet ds  = zc1.GetDetailByID(id, "danwei");
            this.depart.Text = ds.Tables[0].Rows[0][0].ToString();
            zc1.Close();
        }
    }
Пример #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.billtime.Text = DateTime.Now.ToString("yyyy-M-d");
            this.billmen.Text  = User.Identity.Name;
            U_ZCBU  zc1 = new U_ZCBU();
            DataSet ds  = zc1.GetDetailByID(Request.QueryString["zcid"], "danwei,zeren");
            zc1.Close();
            if (ds.Tables[0].Rows.Count > 0)
            {
                Util.SetControlValue(danwei, ds.Tables[0].Rows[0]["danwei"]);
                Util.SetControlValue(zeren, ds.Tables[0].Rows[0]["zeren"]);

                CW_PayBU Pay1 = new CW_PayBU();
                this.bill.Text = Pay1.GetBillNum();
                Pay1.Close();
            }
            this.billtime.Attributes["onfocus"] = "setday(this)";
        }
    }
Пример #12
0
    private void BindData()
    {
        if (Request["zcid"] != null)
        {
            string  id  = Request["zcid"];
            U_ZCBU  zc1 = new U_ZCBU();
            DataSet ds  = zc1.GetDetailByID(id, "depart,zeren,status,statusText,danwei");
            zc1.Close();

            this.danwei.Text     = ds.Tables[0].Rows[0]["danwei"].ToString();
            this.depart.Text     = ds.Tables[0].Rows[0]["depart"].ToString();
            this.zeren.Text      = ds.Tables[0].Rows[0]["zeren"].ToString();
            this.status.Text     = ds.Tables[0].Rows[0]["status"].ToString();
            this.statusText.Text = ds.Tables[0].Rows[0]["statusText"].ToString();
            if (this.statusText.Text == "")
            {
                this.statusText.Text = "阅卷";
            }
            ds.Dispose();
        }
    }
Пример #13
0
    private void BindData()
    {
        if (Request["zcid"] != null)
        {
            string  id  = Request["zcid"];
            U_ZCBU  zc1 = new U_ZCBU();
            DataSet ds  = zc1.GetDetailByID(id);
            zc1.Close();
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < arr1.Length; i++)
                {
                    Util.SetControlValue(this.zcbao.Parent.FindControl(arr1[i]), ds.Tables[0].Rows[0][arr1[i]]);
                }

                if (ds.Tables[0].Rows[0]["time0"] != DBNull.Value)
                {
                    string dt = DateTime.Parse(ds.Tables[0].Rows[0]["time0"].ToString()).ToString("yyyy-MM-dd");
                    Util.SetControlValue(this.zcbao.Parent.FindControl("time0"), dt);
                }
                if (ds.Tables[0].Rows[0]["status"] != DBNull.Value)
                {
                    string st = ds.Tables[0].Rows[0]["statusText"].ToString();
                    Util.SetControlValue(this.zcbao.Parent.FindControl("status"), st);
                }
                //设置数字金额的显示
                string[] num1 = new string[] { "bj", "lx1", "lx2", "lx3", "zczb" };
                for (int i = 0; i < num1.Length; i++)
                {
                    Label l1 = this.bj.Parent.FindControl(num1[i]) as Label;
                    if (l1 != null)
                    {
                        l1.Text = Comm.GetNumberFormat(l1.Text);
                    }
                }
            }
            ds.Dispose();
        }
    }
Пример #14
0
    //绑定资产调查数据
    private void BindData()
    {
        if (Request["id"] != null)
        {
            string  id  = Request["id"];
            U_ZCBU  zc1 = new U_ZCBU();
            DataSet ds  = zc1.GetDetailByID(id, "depart,zeren,status,statusText,danwei,bj");
            zc1.Close();

            this.danwei.Text     = ds.Tables[0].Rows[0]["danwei"].ToString();
            this.status.Text     = ds.Tables[0].Rows[0]["status"].ToString();
            this.statusText.Text = ds.Tables[0].Rows[0]["statusText"].ToString();
            if (this.status.Text == "00")
            {
                this.statusText.Text = "非现场调查(档案核查)";
            }
            else if (this.status.Text == "01")
            {
                this.statusText.Text = "现场调查(抵质押物)";
            }
            else if (this.status.Text == "02")
            {
                this.statusText.Text = "现场调查(保证人)";
            }
            else if (this.status.Text == "03")
            {
                this.statusText.Text = "现场调查(借款人)";
            }

            //this.depart.Text = ds.Tables[0].Rows[0]["depart"].ToString();
            //this.zeren.Text = ds.Tables[0].Rows[0]["zeren"].ToString();

            this.bj.Text = PubComm.GetNumberFormat(ds.Tables[0].Rows[0]["bj"].ToString());


            ds.Dispose();
            this.SetButton();
        }
    }
Пример #15
0
 private void BindData()
 {
     if (Request["zcid"] != null)
     {
         string  id  = Request["zcid"];
         U_ZCBU  zc1 = new U_ZCBU();
         DataSet ds  = zc1.GetDetailByID(id);
         zc1.Close();
         if (ds.Tables[0].Rows.Count > 0)
         {
             for (int i = 0; i < arr1.Length; i++)
             {
                 Util.SetControlValue(this.zzjg.Parent.FindControl(arr1[i]), ds.Tables[0].Rows[0][arr1[i]]);
             }
             if (ds.Tables[0].Rows[0]["clsj"] != DBNull.Value)
             {
                 string dt = DateTime.Parse(ds.Tables[0].Rows[0]["clsj"].ToString()).ToString("yyyy-MM-dd");
                 Util.SetControlValue(this.zzjg.Parent.FindControl("clsj"), dt);
             }
             if (ds.Tables[0].Rows[0]["xdri"] != DBNull.Value)
             {
                 string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xdri"].ToString()).ToString("yyyy-MM-dd");
                 Util.SetControlValue(this.zzjg.Parent.FindControl("xdri"), dt);
             }
             if (ds.Tables[0].Rows[0]["dkffrq1"] != DBNull.Value)
             {
                 string dt = DateTime.Parse(ds.Tables[0].Rows[0]["dkffrq1"].ToString()).ToString("yyyy-MM-dd");
                 Util.SetControlValue(this.zzjg.Parent.FindControl("dkffrq1"), dt);
             }
             if (ds.Tables[0].Rows[0]["dkffrq2"] != DBNull.Value)
             {
                 string dt = DateTime.Parse(ds.Tables[0].Rows[0]["dkffrq2"].ToString()).ToString("yyyy-MM-dd");
                 Util.SetControlValue(this.zzjg.Parent.FindControl("dkffrq2"), dt);
             }
             if (ds.Tables[0].Rows[0]["htdqr"] != DBNull.Value)
             {
                 string dt = DateTime.Parse(ds.Tables[0].Rows[0]["htdqr"].ToString()).ToString("yyyy-MM-dd");
                 Util.SetControlValue(this.zzjg.Parent.FindControl("htdqr"), dt);
             }
             if (ds.Tables[0].Rows[0]["xcyqrq"] != DBNull.Value)
             {
                 string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xcyqrq"].ToString()).ToString("yyyy-MM-dd");
                 Util.SetControlValue(this.zzjg.Parent.FindControl("xcyqrq"), dt);
             }
             if (ds.Tables[0].Rows[0]["jrblsj"] != DBNull.Value)
             {
                 string dt = DateTime.Parse(ds.Tables[0].Rows[0]["jrblsj"].ToString()).ToString("yyyy-MM-dd");
                 Util.SetControlValue(this.zzjg.Parent.FindControl("jrblsj"), dt);
             }
             //设置数字金额的显示
             string[] num1 = new string[] { "dkye", "zjycszje" };
             for (int i = 0; i < num1.Length; i++)
             {
                 Label l1 = this.dkye.Parent.FindControl(num1[i]) as Label;
                 if (l1 != null)
                 {
                     l1.Text = Comm.GetNumberFormat(l1.Text);
                 }
             }
         }
         ds.Dispose();
     }
 }
Пример #16
0
    //设置页面控制的值及显示格式等
    private void SetPageData()
    {
        string  id  = Request["id"];
        U_ZCBU  zc1 = new U_ZCBU();
        DataSet ds  = zc1.GetDetailByID(id);

        zc1.Close();

        //设置控件的值
        bool   owner = false;
        string user1 = "";

        if (ds.Tables[0].Rows[0]["zeren"] != DBNull.Value)
        {
            user1 = ds.Tables[0].Rows[0]["zeren"].ToString();
        }

        if (user1 == User.Identity.Name || (user1.Trim() == "" && Comm.IsRole("系统管理员")))
        {
            owner = true;
        }
        else
        {
            this.but0.Visible = false;
        }

        if (Comm.IsRole("系统管理员"))
        {
            this.Button1.Visible = true;
            this.Button2.Visible = true;
            this.Button3.Visible = true;
        }
        else
        {
            this.Button1.Visible = false;
            this.Button2.Visible = false;
            this.Button3.Visible = false;
        }
        //设置控件数据的显示
        for (int i = 1; i < ds.Tables[0].Columns.Count; i++)
        {
            string colName = ds.Tables[0].Columns[i].ColumnName.ToLower();
            if (owner)
            {
                if (this.zcbao.Parent.FindControl(colName) != null)
                {
                    Util.SetControlValue(this.zcbao.Parent.FindControl(colName), ds.Tables[0].Rows[0][colName]);
                }
                if (this.zcbao.Parent.FindControl(colName + "_1") != null)
                {
                    this.zcbao.Parent.FindControl(colName + "_1").Visible = false;;
                }
            }
            else
            {
                if (this.zcbao.Parent.FindControl(colName + "_1") != null)
                {
                    Util.SetControlValue(this.zcbao.Parent.FindControl(colName + "_1"), ds.Tables[0].Rows[0][colName]);
                }
                if (this.zcbao.Parent.FindControl(colName) != null)
                {
                    this.zcbao.Parent.FindControl(colName).Visible = false;;
                }
            }

            this.status.Text   = ds.Tables[0].Rows[0]["statustext"].ToString();
            this.status_1.Text = ds.Tables[0].Rows[0]["statustext"].ToString();

            if (ds.Tables[0].Rows[0]["time0"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["time0"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("time0"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("time0_1"), dt);
            }

            if (ds.Tables[0].Rows[0]["status"] != DBNull.Value)
            {
                string st = ds.Tables[0].Rows[0]["statusText"].ToString();
                Util.SetControlValue(this.zcbao.Parent.FindControl("status"), st);
                Util.SetControlValue(this.zcbao.Parent.FindControl("status_1"), st);
            }

            if (ds.Tables[0].Rows[0]["clsj"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["clsj"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("clsj"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("clsj_1"), dt);
            }
            if (ds.Tables[0].Rows[0]["xdri"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xdri"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("xdri"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("xdri_1"), dt);
            }
            if (ds.Tables[0].Rows[0]["dkffrq1"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["dkffrq1"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("dkffrq1"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("dkffrq1_1"), dt);
            }
            if (ds.Tables[0].Rows[0]["xcyqrq"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xcyqrq"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("xcyqrq"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("xcyqrq_1"), dt);
            }
            if (ds.Tables[0].Rows[0]["jrblsj"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["jrblsj"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("jrblsj"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("jrblsj_1"), dt);
            }
        }


        //设置转入价的显示
        if (Comm.IsRole("公司领导") || Comm.IsRole("评审部角色"))
        {
            this.zcbao.Parent.FindControl("zhuang_1").Visible = true;
        }
        else
        {
            this.zcbao.Parent.FindControl("zhuang_1").Visible = false;
        }

        //设置数字金额的显示
        string[] num1 = new string[] { "bj", "lx1", "lx2", "lx3", "zczb", "dkye", "zjycszje" };
        for (int i = 0; i < num1.Length; i++)
        {
            TextBox t1 = this.bj.Parent.FindControl(num1[i]) as TextBox;
            Label   l1 = this.bj.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);
            }
        }
    }
Пример #17
0
    //设置页面控件的值
    private void SetPageData1()
    {
        string  id  = Request["id"];
        U_ZCBU  zc1 = new U_ZCBU();
        DataSet ds  = zc1.GetDetailByID(id);

        zc1.Close();
        if (ds.Tables[0].Rows.Count > 0)
        {
            //设置管理员字段
            //for (int i = 0; i < arr1.Length; i++)
            //{
            //    Util.SetControlValue(this.zcbao.Parent.FindControl(arr1[i]), ds.Tables[0].Rows[0][arr1[i]]);
            //    if (this.zcbao.Parent.FindControl(arr1[i] + "_1") != null)
            //    {
            //        //设置对应的标签提示信息
            //        Util.SetControlValue(this.zcbao.Parent.FindControl(arr1[i] + "_1"), ds.Tables[0].Rows[0][arr1[i]]);
            //    }
            //}


            if (ds.Tables[0].Rows[0]["time0"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["time0"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("time0"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("time0_1"), dt);
            }

            if (ds.Tables[0].Rows[0]["status"] != DBNull.Value)
            {
                string st = ds.Tables[0].Rows[0]["statusText"].ToString();
                Util.SetControlValue(this.zcbao.Parent.FindControl("status"), st);
                Util.SetControlValue(this.zcbao.Parent.FindControl("status_1"), st);
            }

            if (ds.Tables[0].Rows[0]["clsj"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["clsj"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("clsj"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("clsj_1"), dt);
            }
            if (ds.Tables[0].Rows[0]["xdri"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xdri"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("xdri"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("xdri_1"), dt);
            }
            if (ds.Tables[0].Rows[0]["dkffrq1"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["dkffrq1"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("dkffrq1"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("dkffrq1_1"), dt);
            }
            if (ds.Tables[0].Rows[0]["xcyqrq"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xcyqrq"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("xcyqrq"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("xcyqrq_1"), dt);
            }
            if (ds.Tables[0].Rows[0]["jrblsj"] != DBNull.Value)
            {
                string dt = DateTime.Parse(ds.Tables[0].Rows[0]["jrblsj"].ToString()).ToString("yyyy-MM-dd");
                Util.SetControlValue(this.zcbao.Parent.FindControl("jrblsj"), dt);
                Util.SetControlValue(this.zcbao.Parent.FindControl("jrblsj_1"), dt);
            }
        }
        ds.Dispose();
        this.bj.Text = Comm.GetNumberFormat(this.bj.Text);

        //设置按钮的权限
        string user1 = this.zeren.Text;

        if (user1 == User.Identity.Name || (user1.Trim() == "" && Comm.IsRole("系统管理员")))
        {
            this.but0.Visible = true;
        }
        else
        {
            this.but0.Visible = false;
        }

        //设置控件数据的显示
        if (user1 == User.Identity.Name || (user1.Trim() == "" && Comm.IsRole("系统管理员")))
        {
            //for (int i = 0; i < arr1.Length; i++)
            //{
            //    if (this.zcbao.Parent.FindControl(arr1[i] + "_1") != null)
            //    {
            //        //设置对应的标签提示信息
            //        this.zcbao.Parent.FindControl(arr1[i] + "_1").Visible = false;
            //    }
            //}

            //for (int i = 0; i < arr2.Length; i++)
            //{
            //    if (this.zcbao.Parent.FindControl(arr2[i] + "_1") != null)
            //    {
            //        //设置对应的标签提示信息
            //        this.zcbao.Parent.FindControl(arr2[i] + "_1").Visible = false;
            //    }
            //}
        }
        else
        {
            //for (int i = 0; i < arr1.Length; i++)
            //{
            //    if (this.zcbao.Parent.FindControl(arr1[i]) != null)
            //    {
            //        //设置对应的标签提示信息
            //        this.zcbao.Parent.FindControl(arr1[i]).Visible = false;
            //    }
            //}

            //for (int i = 0; i < arr2.Length; i++)
            //{
            //    if (this.zcbao.Parent.FindControl(arr2[i]) != null)
            //    {
            //        //设置对应的标签提示信息
            //        this.zcbao.Parent.FindControl(arr2[i]).Visible = false;
            //    }
            //}
        }



        if (Comm.IsRole("公司领导") || Comm.IsRole("评审部角色"))
        {
            this.zcbao.Parent.FindControl("zhuang_1").Visible = true;
        }
        else
        {
            this.zcbao.Parent.FindControl("zhuang_1").Visible = false;
        }
    }