public BLBase() { if (oDL == null) { oDL = new DLBase(); } }
private DLBase GetDLObject(DESettings settings, Dictionary <string, string> filters = null) { string listName = settings.ListName; DLBase defaultList = DMFactory.GetDLObject(listName, settings, filters); return(defaultList); }
/// <summary> /// Load động dữ liệu theo table name /// </summary> /// <param name="tableSource"></param> /// <param name="whereCause"></param> /// <param name="orderBy"></param> public void GetAllDataByTableName(DataTable tableSource, string whereCause = "", string orderBy = "") { if (oDLBase == null) { oDLBase = new DL.DLBase(); } oDLBase.GetAllDataByTableName(tableSource, whereCause, orderBy); }
public virtual void Load(IDataReader dr) { DLBase dal = GetMapper(); dal.Fill(this, dr); LoadSubObjects(); RefreshFlags(); }
public virtual void Load(long id) { DLBase dal = GetMapper(); if (id <= 0) { return; } dal.Select(id, this); LoadSubObjects(); RefreshFlags(); }
private HttpResponseMessage GetContent(DESettings settings, DLBase defaultList) { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); string result = string.Empty; defaultList.Populate(); DefaultListModel model = new DefaultListModel(defaultList.DEList); model.BackURL = string.Format(model.BackURL, settings.BusinessUnit); result = ViewRenderer.RenderView("~/Views/SystemDefaults/DefaultList.cshtml", model, null); response.Content = new StringContent(result); response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html"); return(response); }
protected virtual void Dispose(bool disposing) { if (disposing) { if (dsDataSource != null) { dsDataSource.Dispose(); dsDataSource = null; } if (oDLBase != null) { oDLBase.Dispose(); oDLBase = null; } } }
// GET api/<controller> public HttpResponseMessage GetValues() { SetParamsAndSettings(); if (settings.ListName == string.Empty) { settings.ListName = "Modules"; } try { DLBase defaultList = GetDLObject(settings); return(GetContent(settings, defaultList)); } catch (TypeLoadException) { string message = "This list name does not exists in the application"; return(GetEmptyContent(message)); } }
// POST api/<controller> public HttpResponseMessage PostValue([FromBody()] Dictionary <string, string> values) { if (values["action"] == "delete") { base.SetParamsAndSettings(); DLBase defaultList = GetDLObject(settings, values); if (values != null) { settings.VariableKey1 = values["variableKey1"]; settings.VariableKey2 = values["variableKey2"]; settings.VariableKey3 = values["variableKey3"]; settings.VariableKey4 = values["variableKey4"]; defaultList.Delete(); } return(GetContent(settings, defaultList)); } return(GetEmptyContent()); }
protected virtual void Delete() { DLBase dal = GetMapper(); dal.Delete(this); }
public static string GetTCOption(string key) { return(DLBase.GetTCOption(key)); }
public void getImportDetailForPrint(DataTable tableSource, int id) { oDLBase = new DLBase(); oDLBase.ExecuteTypeParameterReader("proc_Import_Ticket_Prinf", tableSource, id); }
/// <summary> /// /// </summary> /// <returns></returns> public virtual DataTable getConfigByReport() { oDLBase = new DLBase(); return(oDLBase.ExecuteDataTable("proc_cf_station_by_Report")); }
public BLBase() { dl = new DLBase <T>(); }
public virtual bool checkDeleteImport(int ImportId) { oDLBase = new DLBase(); return(oDLBase.CheckExit("proc_CheckStauts_Ticket_Info_Delete_Ticket_Import", ImportId)); }
/// <summary> /// Lấy danh sách user theo RoleID /// </summary> /// <param name="RoleId"></param> /// <returns></returns> public DataTable GetUsersByRole(int RoleId) { oDLBase = new DLBase(); return(oDLBase.ExecuteDataTable("proc_user_info_GetByRole", RoleId)); }
/// <summary> /// Hàm tạo cho trường hợp làm các thao tác không cần master detail đơn giản. /// </summary> public BLBase() { dsDataSource = new DataSet(); DataAccessObject = new DLBase(); }
public static bool IsAuthorizedUser(Guid userID) { var auth = new DLBase <User>(); return(bool.Parse(auth.ExecuteScalar(new { UserID = userID }, "Proc_ValidateToken").ToString())); }
protected virtual void Update() { DLBase dal = GetMapper(); dal.Update(this); }
protected virtual void Insert() { DLBase dal = GetMapper(); dal.Insert(this); }