示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Comm.SetDepart(this.depart, "所有部门");

            /////////////////////////////////////
            ;
            this.depart.SelectedValue = "";
            ///////////////////////////////////////
            U_ItemBU item1 = new U_ItemBU();;

            item1.ItemName = "行政区域";
            item1.SetLiteralControl(this.quyu, "全部...");

            item1.ItemName = "行业分类";
            item1.SetLiteralControl(this.hangye, "全部...");

            item1.ItemName = "资产性质分类";
            item1.SetLiteralControl(this.fenlei, "全部...");

            item1.Setuserkind(this.userkind);
            item1.Close();
            ////////////////////////////////////////////

            depart_SelectedIndexChanged(this.depart, e);
        }
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Comm.SetDepart(this.depart, "所有部门");

            /////////////////////////////////////
            ;
            this.depart.SelectedValue = "";
            ///////////////////////////////////////
            U_ItemBU item1 = new U_ItemBU();;

            item1.ItemName = "行政区域";
            item1.SetLiteralControl(this.quyu, "全部...");

            item1.ItemName = "行业分类";
            item1.SetLiteralControl(this.hangye, "全部...");

            item1.SetStatus(this.jzdc, "尽职调查");

            item1.SetStatus(this.fasp, "方案审批");

            item1.SetStatus(this.fazx, "方案执行");

            item1.Close();

            U_ZCBAOBU zcb1 = new U_ZCBAOBU();
            zcb1.SetBstatus(this.Bstatus, "全部...");
            zcb1.Close();
            ////////////////////////////////////////////

            depart_SelectedIndexChanged(this.depart, e);
        }
    }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Request.QueryString["kind"] != null && Request.QueryString["kind"] == "31")
         {
             U_ZCBU zc1 = new U_ZCBU();
             zc1.SetUserKind(Request.QueryString["id"], "31", "");
             zc1.Close();
             PubComm.ShowInfo("提示:清除用户自定义分类操作成功!", Application["root"] + "/ZcMng1/FixZcUserKind.aspx");
         }
         else if (Request.QueryString["kind"] != null && Request.QueryString["kind"] == "32")
         {
             U_ZCBU zc1 = new U_ZCBU();
             zc1.SetUserKind(Request.QueryString["id"], "32", "");
             zc1.Close();
             PubComm.ShowInfo("提示:清除用户自定义分类操作成功!", Application["root"] + "/ZcMng1/MyFixZcUserKind.aspx");
         }
         else
         {
             U_ItemBU item = new U_ItemBU();
             item.Setuserkind(this.userkind);
             item.Close();
             if (this.userkind.Items.Count > 0)
             {
                 this.userkind.SelectedIndex = 0;
             }
         }
     }
 }
示例#4
0
    //设置政策包类别
    public static void SetZCB(ListControl drop1, string blankValue)
    {
        U_ItemBU item1 = new U_ItemBU();

        item1.ItemName = "政策包";
        item1.SetLiteralControl(drop1, blankValue);
        item1.Close();
    }
示例#5
0
    //bind data1
    private void BindData()
    {
        U_ItemBU item1 = new U_ItemBU();

        this.GridView1.DataSource = item1.GetAllItem();
        this.GridView1.DataBind();
        item1.Close();
    }
示例#6
0
    //统计资产包的情况
    public static double ZcBaoSum(CommTable com1,
                                  out int hs1, out int hs2, out double bjlx1,
                                  out double bjlx2, out double bjlx,
                                  out double hbxh, out double fee
                                  )
    {
        hs1   = 0;          //资产包数量
        hs2   = 0;          //资产包内资产的数量
        bjlx1 = 0;          //本金利息和(人民币)
        bjlx2 = 0;          //本金和利息(美元)
        bjlx  = 0;          //折合人民币后的总和

        hbxh = 0;           //总收回本金和利息
        fee  = 0;           //总费用

        double   temp  = 0;
        U_ItemBU item1 = new U_ItemBU();
        double   huilv = item1.getHuilv();

        item1.Close();

        string  sql = "select * from u_zcbao";
        DataSet ds1 = com1.TableComm.SearchData(sql);

        foreach (DataRow dr in ds1.Tables[0].Rows)
        {
            hs1++;
            double bj1, lx1, bj2, lx2;
            int    hs21;
            string bid = dr["id"].ToString();
            CalBj(com1, bid, out bj1, out lx1, out bj2, out lx2, out hs21);
            bjlx1 += (bj1 + lx1);
            bjlx2 += (bj2 + lx2);
            hs2   += hs21;
        }
        bjlx = bjlx1 + bjlx2 * huilv;

        //统计收回的本金利息
        sql = "select sum(isnull(pbj,0)+isnull(plx,0)) hbxh from CW_ShouKuan1 where checktime is not null";
        ds1.Clear();
        ds1  = com1.TableComm.SearchData(sql);
        hbxh = double.Parse(ds1.Tables[0].Rows[0][0].ToString());

        //统计发生的费用
        sql = @"select sum(
                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)
                 ) 
                 from CW_Pay1 where checktime is not null";
        ds1 = com1.TableComm.SearchData(sql);
        fee = double.Parse(ds1.Tables[0].Rows[0][0].ToString());
        return(huilv);
    }
示例#7
0
 protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.FindControl("gkind") != null)
     {
         DropDownList list1 = (DropDownList)e.Item.FindControl("gkind");
         U_ItemBU     item1 = new U_ItemBU();
         item1.SetLiteralControl(list1, "抵债物资类别", "请选择...");
         item1.Close();
     }
 }
示例#8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            PubComm.SetDepart(this.depart, "所有部门");
            PubComm.SetZCStatus(this.status, "所有状态");


            /////////////////////////////////////

            this.depart.SelectedValue = "";
            this.zcbao.SelectedValue  = "";
            ///////////////////////////////////////
            U_ItemBU item1 = new U_ItemBU();
            item1.ItemName = "政策包";
            item1.SetLiteralControl(this.zcbao, "全部...");
            this.zcbao.SelectedValue = "";

            item1.ItemName = "行政区域";
            item1.SetLiteralControl(this.quyu, "全部...");

            item1.ItemName = "行业分类";
            item1.SetLiteralControl(this.hangye, "全部...");

            item1.ItemName = "资产性质分类";
            item1.SetLiteralControl(this.fenlei, "全部...");


            item1.Close();

            U_ZCBAOBU zcb1 = new U_ZCBAOBU();
            zcb1.SetBstatus(this.Bstatus, "全部...");
            zcb1.Close();
            ////////////////////////////////////////////

            depart_SelectedIndexChanged(this.depart, e);

            U_ItemBU item = new U_ItemBU();
            item.Setuserkind(this.userkind);
            item.Close();


            //调整执行状态的选择 (====2013年新增=====)
            PubComm.SetProfile("方案执行结果", this.spresult, "");
            PubComm.SetProfile("方案执行状态大类", this.status1, "全部...");

            //this.status1.Items.Add(new ListItem("全部...", ""));
            this.status2.Items.Add(new ListItem("全部...", ""));
        }

        this.danwei.Attributes.Add("onkeydown", "javascript:if( event.keyCode == 13 ) { " + this.Button1.ClientID + ".click(); return false; } ");
        this.num1.Attributes.Add("onkeydown", "javascript:if( event.keyCode == 13 ) { " + this.Button1.ClientID + ".click(); return false; } ");
        this.num2.Attributes.Add("onkeydown", "javascript:if( event.keyCode == 13 ) { " + this.Button1.ClientID + ".click(); return false; } ");
    }
示例#9
0
    //页面控件初始化
    private void SetPageControlIni()
    {
        //设置数据字典的条码
        U_ItemBU item1 = new U_ItemBU();

        item1.ItemName = "总行委贷";
        item1.SetLiteralControl(this.zhwd, "请选择...");

        item1.ItemName = "行业分类";
        item1.SetLiteralControl(this.sshy, "请选择...");

        item1.ItemName = "行政区域";
        item1.SetLiteralControl(this.quyu, "请选择...");

        item1.ItemName = "银行定义";
        item1.SetLiteralControl(this.bank, "请选择...");

        item1.ItemName = "资产性质分类";
        item1.SetLiteralControl(this.fenlei, "请选择...");

        item1.ItemName = "企业经营状况";
        item1.SetLiteralControl(this.jysfzc, "请选择...");

        item1.ItemName = "地区经济与信用状况";
        item1.SetLiteralControl(this.dqjj, "请选择...");

        item1.ItemName = "企业规模";
        item1.SetLiteralControl(this.qygm, "请选择...");

        item1.ItemName = "企业经济性质";
        item1.SetLiteralControl(this.qyjjxz, "请选择...");

        item1.ItemName = "债务人有效资产状况";
        item1.SetLiteralControl(this.yxzzzk, "请选择...");

        item1.ItemName = "管辖";
        item1.SetLiteralControl(this.guangxia, "请选择...");

        item1.ItemName = "政策包";
        item1.SetLiteralControl(this.zcbao, "请选择...");
        item1.Close();

        //设置时间控件
        this.time0.Attributes["onfocus"]   = "setday(this)";
        this.clsj.Attributes["onfocus"]    = "setday(this)";
        this.xdri.Attributes["onfocus"]    = "setday(this)";
        this.dkffrq1.Attributes["onfocus"] = "setday(this)";
        this.dkffrq2.Attributes["onfocus"] = "setday(this)";
        this.htdqr.Attributes["onfocus"]   = "setday(this)";
        this.xcyqrq.Attributes["onfocus"]  = "setday(this)";
        this.jrblsj.Attributes["onfocus"]  = "setday(this)";
    }
示例#10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        this.itemvalue.Text = this.itemvalue.Text.Replace(",", ",");
        Hashtable ht = new Hashtable();

        ht.Add("itemvalue", this.itemvalue.Text);
        U_ItemBU item1 = new U_ItemBU();

        item1.SaveObject(Request["id"], ht);
        item1.Close();

        Util.alert(this.Page, "提示:操作成功!");
    }
示例#11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            U_ItemBU item1 = new U_ItemBU();
            item1.ItemName = "资产时效";
            item1.SetLiteralControl(timename, "请选择...");
            item1.Close();

            Comm.SetTimeDays(tellday);
            this.time0.Attributes["onfocus"] = "javascript:setday(this);";
        }
    }
示例#12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            U_ItemBU item1 = new U_ItemBU();
            item1.ItemName = "资产时效";
            item1.SetLiteralControl(timename, null);
            item1.Close();

            Comm.SetTimeDays(tellday);
            this.SetPageData();
        }
    }
示例#13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            U_ItemBU item1 = new U_ItemBU();
            if (Context.Items["wpkind"].ToString() == "0")
            {
                item1.ItemName = "抵押物类别";
                item1.SetLiteralControl(this.wplb, "请选择...");
            }
            else
            {
                item1.ItemName = "质押物类别";
                item1.SetLiteralControl(this.wplb, "请选择...");
            }
            item1.Close();

            if (Context.Items["id"] != null)
            {
                U_ZCBU  zc1 = new U_ZCBU();
                DataSet ds1 = zc1.GetDZYWInfoByID(Context.Items["id"].ToString());
                zc1.Close();

                ViewState["id"] = Context.Items["id"];

                Util.SetControlValue(wplb, ds1.Tables[0].Rows[0]["wplb"]);
                Util.SetControlValue(wpsl, ds1.Tables[0].Rows[0]["wpsl"]);
                Util.SetControlValue(wpdw, ds1.Tables[0].Rows[0]["wpdw"]);
                Util.SetControlValue(wpjz, ds1.Tables[0].Rows[0]["wpjz"]);
            }
            //////////////////////////////////////////////////////////////
            string wpkind = Context.Items["wpkind"].ToString();
            if (wpkind == "0")
            {
                this.dzkind.Text = "抵 押 物 详 细 信 息";
            }
            else
            {
                this.dzkind.Text = "质 押 物 详 细 信 息";
            }
            if (Context.Items["zcid"] != null)
            {
                ViewState["zcid"] = Context.Items["zcid"];
            }
            if (Context.Items["wpkind"] != null)
            {
                ViewState["wpkind"] = Context.Items["wpkind"];
            }
        }
    }
示例#14
0
    /// <summary>
    /// 初始化代码
    /// </summary>
    private void SetMyData()
    {
        Comm.SetDepart(this.depart, "所有部门");
        this.depart.SelectedValue = "";
        this.zcbao.SelectedValue  = "";

        ///////////////////////////////////////
        U_ItemBU item1 = new U_ItemBU();

        item1.ItemName = "政策包";
        item1.SetLiteralControl(this.zcbao, "全部...");
        this.zcbao.SelectedValue = "";

        //调整行政区域
        item1.ItemName = "行政区域";
        item1.SetLiteralControl(this.quyu, "全部...");
        this.quyu.Items.Add(new ListItem("未分类", "null"));

        //调整行业分类
        item1.ItemName = "行业分类";
        item1.SetLiteralControl(this.hangye, "全部...");
        this.hangye.Items.Add(new ListItem("未分类", "null"));

        //调整管辖的处置
        item1.ItemName = "管辖";
        item1.SetLiteralControl(this.guangxia, "全部...");
        this.guangxia.Items.Add(new ListItem("未分类", "null"));

        //调整执行状态的选择
        Comm.SetProfile("方案执行结果", this.spresult, "");
        Comm.SetProfile("方案执行状态大类", this.status1, "全部...");

        //this.status1.Items.Add(new ListItem("全部...", ""));
        this.status2.Items.Add(new ListItem("全部...", ""));


        // Comm.SetProfile("方案执行状态大类", this.status1, "全部...");
        // Comm.SetProfile(this.status1.SelectedValue, this.status2, "全部...");

        item1.Close();

        ////////////////////////////////////////////

        U_ItemBU item = new U_ItemBU();

        item.Setuserkind(this.userkind);
        item.Close();
    }
示例#15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Page.DataBind();
            U_ItemBU item1 = new U_ItemBU();
            item1.ItemName = "案卷类别";
            item1.SetLiteralControl(this.ajkind, "--请选择--");
            item1.Close();

            this.SetControlData();
            this.BindFiles(null);

            this.time0.Attributes["onfocus"] = "setday(this)";
        }
    }
示例#16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            U_ItemBU item1 = new U_ItemBU();

            item1.ItemName = "保证有效性";
            item1.SetLiteralControl(this.bzyx, "请选择...");

            item1.ItemName = "保证人的偿债能力";
            item1.SetLiteralControl(this.bzcznl, "请选择...");

            item1.ItemName = "保证人的偿债意愿";
            item1.SetLiteralControl(this.bzczyy, "请选择...");

            item1.ItemName = "抵押物取得是否存在障碍";
            item1.SetLiteralControl(this.qdza1, "请选择...");

            item1.ItemName = "抵押物处置是否存在障碍";
            item1.SetLiteralControl(this.czza1, "请选择...");

            item1.ItemName = "抵押物变现难易";
            item1.SetLiteralControl(this.bxny1, "请选择...");

            item1.ItemName = "抵押物法律意见";
            item1.SetLiteralControl(this.flyj1, "请选择...");

            item1.ItemName = "质押物取得是否存在障碍";
            item1.SetLiteralControl(this.qdza2, "请选择...");

            item1.ItemName = "质押物处置是否存在障碍";
            item1.SetLiteralControl(this.czza2, "请选择...");

            item1.ItemName = "质押物变现难易";
            item1.SetLiteralControl(this.bxny2, "请选择...");

            item1.ItemName = "质押物法律意见";
            item1.SetLiteralControl(this.flyj2, "请选择...");

            item1.Close();

            this.hssj.Attributes["onfocus"] = "setday(this)";
            ////////////////////////////////////////////////
            this.BindData();
            this.BindDZYW();
        }
    }
示例#17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Request["id"] != null)
         {
             U_ItemBU  item1 = new U_ItemBU();
             Hashtable ht    = item1.GetDetailByID(Request["id"]);
             this.itemtext.Text  = ht["itemtext"].ToString();
             this.itemvalue.Text = ht["itemvalue"].ToString();
             item1.Close();
         }
         else
         {
             Response.Redirect("~/Error.aspx", true);
         }
     }
 }
示例#18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            PubComm.SetAccess(User.Identity.Name, "资产管理员");

            //////////////////////////////////////////////
            U_ItemBU item1 = new U_ItemBU();

            item1.ItemName = "总行委贷";
            item1.SetLiteralControl(this.zhwd, "请选择...");

            item1.ItemName = "行业分类";
            item1.SetLiteralControl(this.sshy, "请选择...");

            item1.ItemName = "银行定义";
            item1.SetLiteralControl(this.bank, "请选择...");

            item1.ItemName = "行政区域";
            item1.SetLiteralControl(this.quyu, "请选择...");

            item1.ItemName = "资产性质分类";
            item1.SetLiteralControl(this.fenlei, "请选择...");

            item1.ItemName = "管辖";
            item1.SetLiteralControl(this.guangxia, "请选择...");


            item1.Setuserkind(this.userkind);

            item1.Close();

            PubComm.SetZCB(this.zcbao, null);
            this.time0.Text = DateTime.Now.ToShortDateString();
            ///////////////////////////////////////////////
        }
    }
示例#19
0
    //统计资产
    public static DataTable ZcTj(CommTable com1, string depart)
    {
        U_ItemBU item1 = new U_ItemBU();
        double   huilv = item1.getHuilv();

        item1.Close();

        double[] sum = new double[12];
        for (int i = 0; i < sum.Length; i++)
        {
            sum[i] = 0;
        }

        //有疑问(资产收钱和资产包收费问题)(不合并包资产情况)
        StringBuilder sql1 = new StringBuilder(@"select isNull(b.statustext,'初始状态') statustext,
                    count(*) hs,sum(bj) bj,sum(lx) lx,
                    sum(bj+lx) bjlx,huobi,sum(pbj) pbj,sum(fee) fee,isNull(status,'00') status
                    from (
                    select u_zc.id,depart,bj,status,huobi,
                    isnull(lx1,0)+isnull(lx2,0)+isNull(lx3,0) lx,
                    isnull(pbj,0)+isnull(plx,0) pbj,
                    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) fee
                    from u_zc left outer join  u_zc3 on u_zc.id=u_zc3.id  ) a
                    left outer join u_zcstatus b on a.status=b.statusValue where not exists
                    (select * from U_ZCBaoInfo where zcid=a.id ) ");

        //合并包资产的情况
        StringBuilder sql = new StringBuilder(@"select isNull(b.statustext,'初始状态') statustext,
                    count(*) hs,sum(bj) bj,sum(lx) lx,
                    sum(bj+lx) bjlx,huobi,sum(pbj) pbj,sum(fee) fee,isNull(status,'00') status
                    from (
                    select u_zc.id,depart,bj,status,huobi,
                    isnull(lx1,0)+isnull(lx2,0)+isNull(lx3,0) lx,
                    isnull(pbj,0)+isnull(plx,0) pbj,
                    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) fee
                    from u_zc left outer join  u_zc3 on u_zc.id=u_zc3.id  ) a
                    left outer join u_zcstatus b on a.status=b.statusValue  ");

        if (String.IsNullOrEmpty(depart) == false)
        {
            sql.Append(" where depart='" + depart + "'");
        }
        sql.Append(" group by a.status,b.statustext,huobi ");
        DataSet ds1 = com1.TableComm.SearchData(sql.ToString());

        //调整数据
        DataTable dt = new DataTable();

        dt.Columns.Add("status");                           //资产状态
        dt.Columns.Add("statusText");                       //资产

        dt.Columns.Add("hs", typeof(Int32));                //户数

        dt.Columns.Add("bj1", typeof(double));              //人民币本金合计
        dt.Columns.Add("lx1", typeof(double));              //人民币利息合计
        dt.Columns.Add("bjlx1", typeof(double));            //人民币本利合计

        dt.Columns.Add("bj2", typeof(double));              //美元本金合计
        dt.Columns.Add("lx2", typeof(double));              //美元利息合计
        dt.Columns.Add("bjlx2", typeof(double));            //人民币本利合计

        dt.Columns.Add("bj3", typeof(double));              //折合人民币本金合计
        dt.Columns.Add("lx3", typeof(double));              //折合人民币利息合计
        dt.Columns.Add("bjlx3", typeof(double));            //折合人民币利息合计

        dt.Columns.Add("pbj", typeof(double));              //归还本金
        dt.Columns.Add("fee", typeof(double));              //费用
        dt.Columns.Add("huilv", typeof(double));            //汇率
        dt.PrimaryKey = new DataColumn[] { dt.Columns["status"] };

        //统计数据
        for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
        {
            DataRow dr1     = ds1.Tables[0].Rows[i];
            string  status1 = dr1["status"].ToString();
            DataRow newdr   = dt.Rows.Find(status1);
            if (newdr == null)
            {
                newdr               = dt.NewRow();
                newdr["status"]     = dr1["status"];
                newdr["statustext"] = dr1["statustext"];
                newdr["huilv"]      = huilv;

                newdr["bj1"]   = 0;
                newdr["lx1"]   = 0;
                newdr["bjlx1"] = 0;

                newdr["bj2"]   = 0;
                newdr["lx2"]   = 0;
                newdr["bjlx2"] = 0;

                newdr["bj3"]   = 0;
                newdr["lx3"]   = 0;
                newdr["bjlx3"] = 0;

                newdr["pbj"] = 0;
                newdr["fee"] = 0;
                newdr["hs"]  = 0;

                dt.Rows.Add(newdr);
            }

            //计算本金和利息合计
            if (dr1["huobi"].ToString() == "美元")
            {
                newdr["bj2"]   = double.Parse(newdr["bj2"].ToString()) + double.Parse(dr1["bj"].ToString());
                newdr["lx2"]   = double.Parse(newdr["lx2"].ToString()) + double.Parse(dr1["lx"].ToString());
                newdr["bjlx2"] = double.Parse(newdr["bjlx2"].ToString()) + double.Parse(dr1["lx"].ToString()) + double.Parse(dr1["bj"].ToString());

                newdr["bj3"]   = double.Parse(newdr["bj3"].ToString()) + double.Parse(dr1["bj"].ToString()) * huilv;
                newdr["lx3"]   = double.Parse(newdr["lx3"].ToString()) + double.Parse(dr1["lx"].ToString()) * huilv;
                newdr["bjlx3"] = double.Parse(newdr["bjlx3"].ToString()) + (double.Parse(dr1["lx"].ToString()) + double.Parse(dr1["bj"].ToString())) * huilv;

                sum[1] += double.Parse(dr1["bj"].ToString()) * huilv;
                sum[2] += double.Parse(dr1["lx"].ToString()) * huilv;
                sum[3] += (double.Parse(dr1["bj"].ToString()) + double.Parse(dr1["lx"].ToString())) * huilv;

                sum[7] += double.Parse(dr1["bj"].ToString());
                sum[8] += double.Parse(dr1["lx"].ToString());
                sum[9] += double.Parse(dr1["bj"].ToString()) + double.Parse(dr1["lx"].ToString());
            }
            else
            {
                newdr["bj1"]   = double.Parse(newdr["bj1"].ToString()) + double.Parse(dr1["bj"].ToString());
                newdr["lx1"]   = double.Parse(newdr["lx1"].ToString()) + double.Parse(dr1["lx"].ToString());
                newdr["bjlx1"] = double.Parse(newdr["bjlx1"].ToString()) + double.Parse(dr1["lx"].ToString()) + double.Parse(dr1["bj"].ToString());

                newdr["bj3"]   = double.Parse(newdr["bj3"].ToString()) + double.Parse(dr1["bj"].ToString());
                newdr["lx3"]   = double.Parse(newdr["lx3"].ToString()) + double.Parse(dr1["lx"].ToString());
                newdr["bjlx3"] = double.Parse(newdr["bjlx3"].ToString()) + (double.Parse(dr1["lx"].ToString()) + double.Parse(dr1["bj"].ToString()));

                sum[1] += double.Parse(dr1["bj"].ToString());
                sum[2] += double.Parse(dr1["lx"].ToString());
                sum[3] += double.Parse(dr1["bj"].ToString()) + double.Parse(dr1["lx"].ToString());

                sum[4] += double.Parse(dr1["bj"].ToString());
                sum[5] += double.Parse(dr1["lx"].ToString());
                sum[6] += double.Parse(dr1["bj"].ToString()) + double.Parse(dr1["lx"].ToString());
            }

            newdr["pbj"] = double.Parse(newdr["pbj"].ToString()) + double.Parse(dr1["pbj"].ToString());
            newdr["fee"] = double.Parse(newdr["fee"].ToString()) + double.Parse(dr1["fee"].ToString());
            newdr["hs"]  = double.Parse(newdr["hs"].ToString()) + double.Parse(dr1["hs"].ToString());

            //统计合计数据
            sum[0]  += double.Parse(dr1["hs"].ToString());
            sum[10] += double.Parse(dr1["pbj"].ToString());
            sum[11] += double.Parse(dr1["fee"].ToString());
        }
        ds1.Clear();
        ds1.Dispose();

        //增加合计数据
        DataRow newdr1 = dt.NewRow();

        newdr1["status"]     = "";
        newdr1["statustext"] = "<font color='#ff0000'>资产合计</font>";
        newdr1["huilv"]      = huilv;

        newdr1["bj1"]   = sum[4];
        newdr1["lx1"]   = sum[5];
        newdr1["bjlx1"] = sum[6];

        newdr1["bj2"]   = sum[7];
        newdr1["lx2"]   = sum[8];
        newdr1["bjlx2"] = sum[9];

        newdr1["bj3"]   = sum[1];
        newdr1["lx3"]   = sum[2];
        newdr1["bjlx3"] = sum[3];

        newdr1["pbj"] = sum[10];
        newdr1["fee"] = sum[11];
        newdr1["hs"]  = sum[0];

        dt.Rows.Add(newdr1);
        return(dt);
    }
示例#20
0
    //统计资产包
    public static DataTable ZcBaoTj(CommTable com1, string depart)
    {
        U_ItemBU item1 = new U_ItemBU();
        double   huilv = item1.getHuilv();

        item1.Close();

        double[] sum = new double[13];
        for (int i = 0; i < sum.Length; i++)
        {
            sum[i] = 0;
        }
        StringBuilder sql = new StringBuilder(@"select * from
                ( select U_zcbao.id,depart,isnull(bstatus,'00') status,
                isNull(statustext,'初始状态') statustext,
                isnull(bljsk,0) pbj, isnull(bljzc,0) fee
                from u_zcbao left outer join U_UserName on U_zcbao.bzeren=U_UserName.sname
                left outer join u_zcstatus on U_zcbao.bstatus=u_zcstatus.statusvalue
                ) a  inner join
                ( select bid,count(*) hs
                from u_zc inner join u_zcbaoinfo on u_zc.id=u_zcbaoinfo.zcid
                group by u_zcbaoinfo.bid ) b
                on a.id=b.bid ");

        if (String.IsNullOrEmpty(depart) == false)
        {
            sql.Append(" where depart='" + depart + "'");
        }
        sql.Append(" order by status ");
        DataSet ds1 = com1.TableComm.SearchData(sql.ToString());

        //调整数据
        DataTable dt = new DataTable();

        dt.Columns.Add("status");                           //资产状态
        dt.Columns.Add("statusText");                       //资产

        dt.Columns.Add("hs", typeof(Int32));                //包内资产数
        dt.Columns.Add("hs1", typeof(Int32));               //资产包数

        dt.Columns.Add("bj1", typeof(double));              //人民币本金合计
        dt.Columns.Add("lx1", typeof(double));              //人民币利息合计
        dt.Columns.Add("bjlx1", typeof(double));            //人民币本利合计

        dt.Columns.Add("bj2", typeof(double));              //美元本金合计
        dt.Columns.Add("lx2", typeof(double));              //美元利息合计
        dt.Columns.Add("bjlx2", typeof(double));            //人民币本利合计

        dt.Columns.Add("bj3", typeof(double));              //折合人民币本金合计
        dt.Columns.Add("lx3", typeof(double));              //折合人民币利息合计
        dt.Columns.Add("bjlx3", typeof(double));            //折合人民币利息合计

        dt.Columns.Add("pbj", typeof(double));              //归还本金
        dt.Columns.Add("fee", typeof(double));              //费用
        dt.Columns.Add("huilv", typeof(double));            //汇率
        dt.PrimaryKey = new DataColumn[] { dt.Columns["status"] };

        //统计数据
        for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
        {
            DataRow dr1     = ds1.Tables[0].Rows[i];
            string  status1 = dr1["status"].ToString();
            DataRow newdr   = dt.Rows.Find(status1);
            if (newdr == null)
            {
                newdr               = dt.NewRow();
                newdr["status"]     = dr1["status"];
                newdr["statustext"] = dr1["statustext"];
                newdr["huilv"]      = huilv;

                newdr["bj1"]   = 0;
                newdr["lx1"]   = 0;
                newdr["bjlx1"] = 0;

                newdr["bj2"]   = 0;
                newdr["lx2"]   = 0;
                newdr["bjlx2"] = 0;

                newdr["bj3"]   = 0;
                newdr["lx3"]   = 0;
                newdr["bjlx3"] = 0;

                newdr["pbj"] = 0;
                newdr["fee"] = 0;
                newdr["hs"]  = 0;
                newdr["hs1"] = GetZcBaoCount(com1, dr1["status"].ToString());
                sum[12]     += double.Parse(newdr["hs1"].ToString());
                dt.Rows.Add(newdr);
            }

            //根据包的ID计算其中的本金合计和利息合计(分美元和人民币)
            Double bj1, lx1, bj2, lx2;
            int    hs1;
            CalBj(com1, dr1["bid"].ToString(), out bj1, out lx1, out bj2, out lx2, out hs1);

            //设置数据
            newdr["bj1"]   = double.Parse(newdr["bj1"].ToString()) + bj1;
            newdr["lx1"]   = double.Parse(newdr["lx1"].ToString()) + lx1;
            newdr["bjlx1"] = double.Parse(newdr["bjlx1"].ToString()) + bj1 + lx1;
            newdr["bj2"]   = double.Parse(newdr["bj2"].ToString()) + bj2;
            newdr["lx2"]   = double.Parse(newdr["lx2"].ToString()) + lx2;
            newdr["bjlx2"] = double.Parse(newdr["bjlx2"].ToString()) + bj2 + lx2;
            newdr["bj3"]   = double.Parse(newdr["bj3"].ToString()) + bj1 + bj2 * huilv;
            newdr["lx3"]   = double.Parse(newdr["lx3"].ToString()) + lx1 + lx2 * huilv;
            newdr["bjlx3"] = double.Parse(newdr["bjlx3"].ToString()) + bj1 + lx1 + (bj2 + lx2) * huilv;

            //计算统计数据
            sum[1] += bj1 + bj2 * huilv;
            sum[2] += lx1 + lx2 * huilv;
            sum[3] += bj1 + lx1 + (bj2 + lx2) * huilv;

            sum[4] += bj1;
            sum[5] += lx1;
            sum[6] += bj1 + lx1;

            sum[7] += bj2;
            sum[8] += lx2;
            sum[9] += bj2 + lx2;

            newdr["pbj"] = double.Parse(newdr["pbj"].ToString()) + double.Parse(dr1["pbj"].ToString());
            newdr["fee"] = double.Parse(newdr["fee"].ToString()) + double.Parse(dr1["fee"].ToString());
            newdr["hs"]  = double.Parse(newdr["hs"].ToString()) + double.Parse(dr1["hs"].ToString());
            //newdr["hs1"] = double.Parse(newdr["hs1"].ToString()) + 1;

            //统计合计数据
            sum[0]  += double.Parse(dr1["hs"].ToString());
            sum[10] += double.Parse(dr1["pbj"].ToString());
            sum[11] += double.Parse(dr1["fee"].ToString());
        }
        ds1.Clear();
        ds1.Dispose();

        //增加合计数据
        DataRow newdr1 = dt.NewRow();

        newdr1["status"]     = "";
        newdr1["statustext"] = "<font color='#ff0000'>包合计</font>";
        newdr1["huilv"]      = huilv;

        newdr1["bj1"]   = sum[4];
        newdr1["lx1"]   = sum[5];
        newdr1["bjlx1"] = sum[6];

        newdr1["bj2"]   = sum[7];
        newdr1["lx2"]   = sum[8];
        newdr1["bjlx2"] = sum[9];

        newdr1["bj3"]   = sum[1];
        newdr1["lx3"]   = sum[2];
        newdr1["bjlx3"] = sum[3];

        newdr1["pbj"] = sum[10];
        newdr1["fee"] = sum[11];
        newdr1["hs"]  = sum[0];
        newdr1["hs1"] = sum[12];

        dt.Rows.Add(newdr1);
        return(dt);
    }
示例#21
0
    //统计公司的总资产情况
    public static double  ZcSum1(CommTable com1,
                                 out int hs, out double bjlx1, out double bjlx2,
                                 out double bjlx,
                                 out double hbxh, out double fee
                                 )
    {
        hs    = 0;          //总户数
        bjlx1 = 0;          //本金利息和(人民币)
        bjlx2 = 0;          //本金和利息(美元)
        bjlx  = 0;          //折合人民币后的总和

        hbxh = 0;           //总收回本金和利息
        fee  = 0;           //总费用

        double temp = 0;

        U_ItemBU item1 = new U_ItemBU();
        double   huilv = item1.getHuilv();

        item1.Close();

        string  sql1 = @"select count(*) as hs,sum(isnull(bj,0)+ isnull(lx1,0)+isnull(lx2,0)+isnull(lx3,0)) bjlx,
                        huobi from u_zc group by huobi";
        DataSet ds1  = com1.TableComm.SearchData(sql1);

        foreach (DataRow dr in ds1.Tables[0].Rows)
        {
            hs  += int.Parse(dr["hs"].ToString());
            temp = double.Parse(dr["bjlx"].ToString());
            if (dr["huobi"].ToString() == "美元")
            {
                bjlx2 = bjlx2 + temp;
            }
            else
            {
                bjlx1 = bjlx1 + temp;
            }
        }
        temp = bjlx2;
        bjlx = bjlx1 + temp * huilv;

        //统计收回的本金利息
        sql1 = "select sum(isnull(pbj,0)+isnull(plx,0)) hbxh from CW_ShouKuan where checktime is not null";
        ds1.Clear();
        ds1  = com1.TableComm.SearchData(sql1);
        hbxh = double.Parse(ds1.Tables[0].Rows[0][0].ToString());

        //统计发生的费用
        sql1 = @"select sum(
                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)
                 ) 
                 from CW_Pay where checktime is not null";
        ds1  = com1.TableComm.SearchData(sql1);
        fee  = double.Parse(ds1.Tables[0].Rows[0][0].ToString());
        return(huilv);
    }