public string GetNextCode(string pCode) { string result = "001"; pCode = string.IsNullOrEmpty(pCode) ? string.Empty : pCode; object obj = new DictionaryDA().GetMaxCode(pCode); if (obj == null) { return(result); } if (string.IsNullOrEmpty(pCode)) { result = (int.Parse(obj.ToString().Substring(0, 3)) + 1).ToString("000"); } else { string strTemp = obj.ToString(); strTemp = string.IsNullOrEmpty(strTemp) ? "000" : strTemp; result = pCode + (int.Parse(strTemp.Substring(strTemp.Length - 3)) + 1).ToString("000"); } return(result); }
public bool Add(DictionaryModel model, Guid userID, DateTime dt) { int iCount = new DictionaryDA().Add(model.DicCode, model.EN_Name, model.CHS_Name, model.CHT_Name , model.ParentCode, model.Remark, model.Index , model.IsDisable, userID, dt , model.Extend1, model.Extend2, model.Extend3, model.Extend4); return(iCount > 0 ? true : false); }
public DictionaryModel GetByID(string code) { DictionaryModel model = new DictionaryModel(); code = string.IsNullOrEmpty(code) ? string.Empty : code; DataSet ds = new DictionaryDA().Get(code); model = ds.ToList <DictionaryModel>().FirstOrDefault(); return(model); }
public IList <DictionaryVM> GetList(string pCode, bool?isDisable, string localization) { IList <DictionaryVM> list = new List <DictionaryVM>(); pCode = string.IsNullOrEmpty(pCode) ? string.Empty : pCode; DataSet ds = new DictionaryDA().GetByParent(pCode, isDisable, localization); list = ds.ToList <DictionaryVM>(); return(list); }
public IList <DictionaryModel> GetList(string pCode) { IList <DictionaryModel> list = new List <DictionaryModel>(); pCode = string.IsNullOrEmpty(pCode) ? string.Empty : pCode; DataSet ds = new DictionaryDA().GetByParent(pCode); list = ds.ToList <DictionaryModel>(); return(list); }
public bool Update(DictionaryModel model, Guid userID, DateTime dt) { if (model == null || string.IsNullOrEmpty(model.DicCode)) { return(false); } bool result = new DictionaryDA().Update(model.DicCode, model.EN_Name, model.CHS_Name, model.CHT_Name , model.ParentCode, model.Remark, model.Index , model.IsDisable, userID, DateTime.Now , model.Extend1, model.Extend2, model.Extend3, model.Extend4); return(result); }
public static List <Dictionary> GetList(string where) { List <Dictionary> dictionaryList = new List <Dictionary>(); foreach (DictionaryDA dictionaryDA in DictionaryDA.FindAll(where)) { Dictionary dictionary = new Dictionary(dictionaryDA); dictionaryList.Add(dictionary); } dictionaryList.Sort(); return(dictionaryList); }
public bool Delete() { try { foreach (DictionaryDA dictionaryDA in DictionaryDA.FindAll(string.Format("where [ParentID]={0}", ID))) { dictionaryDA.Delete(); dictionaryDA.Save(); } m_DictionaryDA.Delete(); m_DictionaryDA.Save(); return(true); } catch (Exception exception) { Loger.Instance.WriteErrorLog(exception.Message); return(false); } }
public bool Delete(string code) { int iCount = new DictionaryDA().Delete(code); return(iCount > 0 ? true : false); }
public void Retrieve(int id) { m_DictionaryDA = DictionaryDA.Get(id); }
private Dictionary(DictionaryDA dictionaryDA) { m_DictionaryDA = dictionaryDA; }
public Dictionary() { m_DictionaryDA = new DictionaryDA(); }