Beispiel #1
0
 private ZSZXFJModel Getmm(DataRow dr, DB_OPT dbo)
 {
     ZSZXFJModel model = new ZSZXFJModel {
         pk = dr["pk"].ToString(),
         Discription = dr["Discription"].ToString(),
         ExecuteValue1 = decimal.Parse(dr["ExecuteValue1"].ToString()),
         ExecuteValue2 = decimal.Parse(dr["ExecuteValue2"].ToString()),
         ExecuteValue3 = decimal.Parse(dr["ExecuteValue3"].ToString()),
         OperationPK = dr["OperationPK"].ToString()
     };
     if (model.OperationPK.Trim() != "")
     {
         string strSql = "select Name FROM GOV_TC_DB_OPRATETACHE where PK='" + model.OperationPK.Trim() + "'";
         model.OperationName = dbo.SelectString(strSql, null);
     }
     model.SFPK = dr["SFPK"].ToString();
     SFTypeModel model2 = new SFTypeDal {
         PK = dr["SFPK"].ToString().Trim()
     };
     model2 = model2.GetModel(dbo);
     model.Sfinfo = model2;
     model.ProjectType = dr["ProjectType"].ToString();
     UsualBookTableModel model3 = new UsualBookTableDal {
         PK = dr["ProjectType"].ToString().Trim()
     };
     model3 = model3.GetModel(false, dbo);
     model.ProjecttypeInfo = model3;
     model.TermName1 = dr["TermName1"].ToString();
     model.TermName2 = dr["TermName2"].ToString();
     model.flog = int.Parse(dr["flog"].ToString());
     return model;
 }
 public UsualBookTableModel[] GetMenus(string parentid)
 {
     UsualBookTableModel[] modelArray;
     try
     {
         this.dbo = new DB_OPT();
         this.dbo.Open();
         modelArray = new UsualBookTableDal { TableName = parentid.Split(new char[] { '|' })[1] }.GetModels("FatherPK='" + parentid.Split(new char[] { '|' })[0] + "'", false, this.dbo);
     }
     catch (Exception)
     {
         modelArray = null;
     }
     finally
     {
         if (this.dbo != null)
         {
             this.dbo.Close();
         }
     }
     return modelArray;
 }