예제 #1
0
 //设置容载比
 private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     //FormPSP_VolumeBalanceVolumecalc calc = new FormPSP_VolumeBalanceVolumecalc();
     //calc.SetSpanText = 1.9;
     //if (calc.ShowDialog() == DialogResult.OK)
     //{
     //    RongZai220 = calc.SetSpanText.ToString();
     //    LoadData();
     //}
     FrmRZ frm = new FrmRZ();
     string conn = "ParentID='0' and ProjectID='" + GetProjectID + "'";
     IList pareList = Common.Services.BaseService.GetList("SelectPs_Table_100PHListByConn", conn);
     for (int i = 0; i < pareList.Count; i++)
     {
         string by = ((Ps_Table_100PH)pareList[i]).BuildYear;
         if (by == null || by == "")
             ((Ps_Table_100PH)pareList[i]).BuildYear = rongZai220; ;
     }
     frm.BindList = pareList;
     frm.RZ = rongZai220;
     if (frm.ShowDialog() == DialogResult.OK)
     {
         RongZai220 = frm.RZ;
         LoadData();
     }
 }
예제 #2
0
 //设置容载比 存放在BuildYear字段中
 private void barButtonItem17_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     FrmRZ frm = new FrmRZ();
     string conn = "ParentID='0' and ProjectID='" + GetProjectID + "'";
     IList pareList = Common.Services.BaseService.GetList("SelectPs_Table_220ResultByConn", conn);
     for (int i = 0; i < pareList.Count; i++)
     {
         string by = ((Ps_Table_220Result)pareList[i]).BuildYear;
         if (by == null || by == "")
             ((Ps_Table_220Result)pareList[i]).BuildYear = RongZai220; ;
     }
     frm.BindList = pareList;
     frm.RZ = RongZai220;
     frm.BRst = false;
     if (frm.ShowDialog() == DialogResult.OK)
     {
         RongZai220 = frm.RZ;
         UpDataRZB();
     }
 }
예제 #3
0
        //设置容载比
        private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string tempID = treeList1.FocusedNode.GetValue("ID").ToString();
            FrmRZ frm = new FrmRZ();
            string conn = "ParentID='0' and ProjectID='" + GetProjectID + "'";
            IList pareList = Common.Services.BaseService.GetList("SelectPs_Table_100PHListByConn", conn);
            for (int i = 0; i < pareList.Count; i++)
            {
                string by = ((Ps_Table_100PH)pareList[i]).BuildYear;
                if (by == null || by == "")
                    ((Ps_Table_100PH)pareList[i]).BuildYear = rongZai110; ;
            }
            frm.BindList = pareList;
            frm.BRst = false;
            frm.RZ = rongZai110;
            if (frm.ShowDialog() == DialogResult.OK)
            {
               //更新容载比

                string connstr = "ProjectID='" + GetProjectID + "' and ParentID='0'";
                IList pList = Common.Services.BaseService.GetList("SelectPs_Table_100PHListByConn", connstr);
                for (int k = 0; k < pList.Count; k++)
                {

                    Ps_Table_100PH table = new Ps_Table_100PH();
                    //DataTable temptable = new DataTable();
                    string rzconn = "ProjectID='" + GetProjectID + "'  and Title = '容载比'  and ParentID='" + ((Ps_Table_100PH)pList[k]).ID.ToString()+"'";
                    IList rzlist = Common.Services.BaseService.GetList("SelectPs_Table_100PHListByConn", rzconn);
                   // Ps_Table_100PH table =(Ps_Table_100PH)Itop.Common.DataConverter.ToDataTable(rzlist, typeof(Ps_Table_100PH));
                    Ps_YearRange range = yAnge;
                    table.ID = ((Ps_Table_100PH)rzlist[0]).ID.ToString();
                    table.Title = ((Ps_Table_100PH)rzlist[0]).Title.ToString();
                    table.Sort = ((Ps_Table_100PH)rzlist[0]).Sort;
                    table.ProjectID = GetProjectID;
                    table.ParentID = ((Ps_Table_100PH)rzlist[0]).ParentID.ToString();
                    table.Col1 = ((Ps_Table_100PH)rzlist[0]).Col1.ToString();
                    table.Col2 = ((Ps_Table_100PH)rzlist[0]).Col2.ToString();
                    double tempdb=double.Parse(((Ps_Table_100PH)pList[k]).BuildYear.ToString());
                    for (int i = range.StartYear; i <= range.FinishYear; i++)
                    {
                        table.GetType().GetProperty("y" + i.ToString()).SetValue(table,tempdb , null);
                    }

                    for (int j = range.FinishYear + 1; j <= range.EndYear; j++)
                    {
                        table.GetType().GetProperty("y" + j.ToString()).SetValue(table, tempdb, null);
                    }
                    try
                    {
                        Common.Services.BaseService.Update("UpdatePs_Table_100PH", table);
                    }
                    catch (Exception ew)
                    {

                        MessageBox.Show("设置容载比出错!" + ew.Message);
                    }
                    //更新相关数据关系
                    DataChange(table.Sort, table.ID, table.ParentID);

                }

                RongZai110 = frm.RZ;
                LoadData();
                FoucsLocation(tempID, treeList1.Nodes);
            }
        }