/// <summary> /// Create detail for HDG /// </summary> /// <param name="HDG"></param> /// <returns></returns> internal string HDGDetail(string HDG) { if (!string.IsNullOrWhiteSpace(HDG)) { Data_Schema.HDGDataTable HDGTable = (new Admin_Proxy()).GetAllTable(); foreach (Data_Schema.HDGRow rowHDG in HDGTable) { if (HDG == rowHDG.HDGID) { string outs = ""; if (!string.IsNullOrWhiteSpace(rowHDG.Line1)) { outs = rowHDG.Line1; } if (!string.IsNullOrWhiteSpace(rowHDG.Line2)) { if (outs.Length > 0) { outs = string.Format("{0}{1}{2}", outs, Constants.CommonConst.SelectorNewLine, rowHDG.Line2); } else { outs = rowHDG.Line2; } } return(outs); } } } return(null); }
public void Insert(string HDGID, string line1, string line2) { if (string.IsNullOrWhiteSpace(HDGID)) { return; } if (string.IsNullOrWhiteSpace(line1)) { line1 = string.Empty; } if (string.IsNullOrWhiteSpace(line2)) { line2 = string.Empty; } Data_Schema.HDGDataTable dt = GetAllTable(); foreach (Data_Schema.HDGRow rw in dt.Rows) { if (HDGID == rw.HDGID) { return; } } dt.AddHDGRow(HDGID, line1, line2); Utils.DataTableWriteToFile(Utils.CreatePhysicalFileName(Constants.FileName.HDGFileName), dt); }
public Data_Schema.HDGDataTable GetAllTable() { Data_Schema.HDGDataTable dt = (Data_Schema.HDGDataTable)Utils.DataTableReadFromFile(Utils.CreatePhysicalFileName(Constants.FileName.HDGFileName), new Data_Schema.HDGDataTable()); if (dt == null) { dt = new Data_Schema.HDGDataTable(); } return(dt); }
public void Delete(string HDGID, string line1, string line2, string original_HDGID) { if (string.IsNullOrWhiteSpace(original_HDGID)) { return; } Data_Schema.HDGDataTable dt = GetAllTable(); Data_Schema.HDGRow rw; for (int i = dt.Rows.Count; i > 0; i--) { rw = (Data_Schema.HDGRow)dt.Rows[i - 1]; if (original_HDGID == rw.HDGID) { dt.Rows.RemoveAt(i - 1); } } Utils.DataTableWriteToFile(Utils.CreatePhysicalFileName(Constants.FileName.HDGFileName), dt); }
public void Update(string Line1, string Line2, string original_HDGID, string original_Line1, string original_Line2) { Data_Schema.HDGDataTable dt = GetAllTable(); if (string.IsNullOrWhiteSpace(Line1)) { Line1 = string.Empty; } if (string.IsNullOrWhiteSpace(Line2)) { Line2 = string.Empty; } foreach (Data_Schema.HDGRow rw in dt.Rows) { if (original_HDGID == rw.HDGID) { rw.Line1 = Line1; rw.Line2 = Line2; } } Utils.DataTableWriteToFile(Utils.CreatePhysicalFileName(Constants.FileName.HDGFileName), dt); }