示例#1
0
 public BLBase()
 {
     if (oDL == null)
     {
         oDL = new DLBase();
     }
 }
示例#2
0
        private DLBase GetDLObject(DESettings settings, Dictionary <string, string> filters = null)
        {
            string listName    = settings.ListName;
            DLBase defaultList = DMFactory.GetDLObject(listName, settings, filters);

            return(defaultList);
        }
示例#3
0
 /// <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);
 }
示例#4
0
        public virtual void Load(IDataReader dr)
        {
            DLBase dal = GetMapper();

            dal.Fill(this, dr);
            LoadSubObjects();
            RefreshFlags();
        }
示例#5
0
        public virtual void Load(long id)
        {
            DLBase dal = GetMapper();

            if (id <= 0)
            {
                return;
            }

            dal.Select(id, this);
            LoadSubObjects();
            RefreshFlags();
        }
示例#6
0
        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);
        }
示例#7
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (dsDataSource != null)
         {
             dsDataSource.Dispose();
             dsDataSource = null;
         }
         if (oDLBase != null)
         {
             oDLBase.Dispose();
             oDLBase = null;
         }
     }
 }
示例#8
0
 // 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));
     }
 }
示例#9
0
 // 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());
 }
示例#10
0
        protected virtual void Delete()
        {
            DLBase dal = GetMapper();

            dal.Delete(this);
        }
示例#11
0
 public static string GetTCOption(string key)
 {
     return(DLBase.GetTCOption(key));
 }
示例#12
0
 public void getImportDetailForPrint(DataTable tableSource, int id)
 {
     oDLBase = new DLBase();
     oDLBase.ExecuteTypeParameterReader("proc_Import_Ticket_Prinf", tableSource, id);
 }
示例#13
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public virtual DataTable getConfigByReport()
 {
     oDLBase = new DLBase();
     return(oDLBase.ExecuteDataTable("proc_cf_station_by_Report"));
 }
示例#14
0
 public BLBase()
 {
     dl = new DLBase <T>();
 }
示例#15
0
 public virtual bool checkDeleteImport(int ImportId)
 {
     oDLBase = new DLBase();
     return(oDLBase.CheckExit("proc_CheckStauts_Ticket_Info_Delete_Ticket_Import", ImportId));
 }
示例#16
0
 /// <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));
 }
示例#17
0
 /// <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()));
        }
示例#19
0
        protected virtual void Update()
        {
            DLBase dal = GetMapper();

            dal.Update(this);
        }
示例#20
0
        protected virtual void Insert()
        {
            DLBase dal = GetMapper();

            dal.Insert(this);
        }