private static List <arithmetic> getArithmetics(string id) { List <arithmetic> result = new List <arithmetic>(); string sql = string.Format(@"with a as (SELECT T.ARITHMETIC_CODE, T.ID AS METIC_ID FROM pt6.PM_TASK_INFO PT LEFT JOIN TDM.TDM_ARITHMETIC_MANAGEMENT T ON PT.TASK_METIC_CODE = T.ARITHMETIC_CODE WHERE PT.ID = '{0}') select sa.id, a.ARITHMETIC_CODE, sa.attach_name from a left join pt6.sys_attachment sa on sa.parent_register_id = a.METIC_ID" , id); DataSet ds = OracleHelper.Query(sql); foreach (DataRow dr in ds.Tables[0].Rows) { arithmetic item = arithmetic.Parse(dr); if (!string.IsNullOrEmpty(item.arithmeticCode)) { result.Add(item); } } return(result); }
public static arithmetic Parse(DataRow element) { arithmetic result = new arithmetic(); result.arithmeticCode = element["ARITHMETIC_CODE"].ToString(); result.attachName = element["ATTACH_NAME"].ToString(); result.url = System.Configuration.ConfigurationManager.AppSettings["scriptdownuri"].ToString() + element["ID"].ToString(); return(result); }
public static arithmetic Parse(XElement element) { if (element.Elements().Count() == 0) { return(null); } arithmetic result = new arithmetic(); result.arithmeticCode = element.Element("arithmeticCode").Value; result.attachName = element.Element("attachName").Value; result.url = element.Element("url").Value; return(result); }