예제 #1
0
 public KhoKhachHangRepository(ContextDto context) : base(context.dbQLNSConnection)
 {
     _Context = context;
     OrmConfiguration.DefaultDialect = SqlDialect.MsSql;
 }
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public GetListKhoDuyetPhieuByCriteriaBiz(ContextDto context) : base(context)
 {
     _context = context;
 }
예제 #3
0
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public UpdateBaoHiemXaHoiBiz(ContextDto context)
 {
     _context = context;
 }
예제 #4
0
        public async Task <ActionResultDto> Execute(ContextDto context)
        {
            GetListKyLuatByCriterialBiz biz = new GetListKyLuatByCriterialBiz(context);
            var result = new ActionResultDto();

            try
            {
                var _draw   = Protector.Int(draw);
                var _start  = Protector.Int(start);
                var _length = Protector.Int(length);

                /* =========================
                 * fixed input
                 * ========================= */
                sortName = string.IsNullOrEmpty(sortName) ? "KyLuatId" : sortName;
                sortDir  = string.IsNullOrEmpty(sortDir) ? "asc" : sortDir;
                _length  = _length < 1 ? 10 : _length;
                fields   = string.IsNullOrEmpty(fields) ? "ngay,ho +' ' +ten as hoten,Tien,HinhThuc,So,LyDo" : fields;
                if (search != null && search != "")
                {
                    try
                    {
                        if (search.Split('|')[1] != "" && search.Split('|')[1] != "__/__/____")
                        {
                            biz.TuNgay = DateTime.ParseExact(search.Split('|')[1], "dd/MM/yyyy", CultureInfo.GetCultureInfo("fr-FR")).ToString("yyyy-MM-dd");
                        }
                    }
                    catch
                    {
                        biz.TuNgay = "";
                    }
                    try
                    {
                        if (search.Split('|')[2] != "" && search.Split('|')[2] != "__/__/____")
                        {
                            biz.DenNgay = DateTime.ParseExact(search.Split('|')[2], "dd/MM/yyyy", CultureInfo.GetCultureInfo("fr-FR")).ToString("yyyy-MM-dd");
                        }
                    }
                    catch
                    {
                        biz.DenNgay = "";
                    }
                    biz.NhanVien = search.Split('|')[0];
                    if (search.Split('|')[3] != "")
                    {
                        biz.HinhThuc = search.Split('|')[3].Substring(0, search.Split('|')[3].Length - 1);
                    }
                }
                var orderClause = sortName + " " + sortDir;
                var total       = 0;
                biz.FieldsField = fields;
                biz.OrderClause = orderClause;
                biz.Skip        = _start;
                biz.Take        = _length;
                IEnumerable <dynamic> listKhenThuong = await biz.Execute();

                if (listKhenThuong.Count() > 0)
                {
                    var obj = listKhenThuong.FirstOrDefault();

                    total = Protector.Int(obj.MAXCNT);
                }

                dynamic _metaData = new System.Dynamic.ExpandoObject();
                _metaData.draw  = _draw;
                _metaData.total = total;

                return(ActionHelper.returnActionResult(HttpStatusCode.OK, listKhenThuong, _metaData));
            }
            catch (Exception ex)
            {
                result.ReturnCode = HttpStatusCode.InternalServerError;
                result.ReturnData = new
                {
                    error = new
                    {
                        code    = HttpStatusCode.InternalServerError,
                        type    = HttpStatusCode.InternalServerError.ToString(),
                        message = ex.InnerException != null ? ex.InnerException.Message : ex.Message
                    }
                };
                return(result);
            }
        }
예제 #5
0
 public KhenThuongCaNhanRepository(ContextDto context) : base(context.dbQLNSConnection)
 {
     _Context = context;
     OrmConfiguration.DefaultDialect = SqlDialect.MsSql;
 }
예제 #6
0
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public GetThongTinByDienThoaiDac(ContextDto context) : base(context.dbQLNSConnection)
        {
            OrmConfiguration.DefaultDialect = SqlDialect.MsSql;

            _context = context;
        }
예제 #7
0
 public KhoPhieuNhapSeriesRepository(ContextDto context) : base(context.dbQLNSConnection)
 {
     _Context = context;
     OrmConfiguration.DefaultDialect = SqlDialect.MsSql;
 }
예제 #8
0
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public GetListHocVanByIdDac(ContextDto context) : base(context.dbQLNSConnection)
        {
            OrmConfiguration.DefaultDialect = SqlDialect.MsSql;

            _context = context;
        }
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public GetListSeriesReportPhieuXuatByIdBiz(ContextDto context) : base(context)
 {
 }
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public UpdateTonDauKhoChiTietByTonKhoChiTietIdBiz(ContextDto context) : base(context)
 {
     _context = context;
 }
예제 #11
0
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public GetListKhoKyPopupByCriteriaBiz(ContextDto context) : base(context)
 {
 }
예제 #12
0
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public LuuSoCaiDac(ContextDto context) : base(context.dbQLNSConnection)
        {
            OrmConfiguration.DefaultDialect = SqlDialect.MsSql;

            _context = context;
        }
예제 #13
0
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public GetListKhoHangHoaByMaTenDac(ContextDto context) : base(context.dbQLNSConnection)
        {
            OrmConfiguration.DefaultDialect = SqlDialect.MsSql;

            _context = context;
        }
예제 #14
0
 public BaoHiemXaHoiRepository(ContextDto context) : base(context.dbQLNSConnection)
 {
     OrmConfiguration.DefaultDialect = SqlDialect.MsSql;
 }
예제 #15
0
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public GetListLichSuBanThanByIdBiz(ContextDto context) : base(context)
 {
 }
예제 #16
0
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public GetListQuanLyHopDongByCriteriaBiz(ContextDto context) : base(context)
 {
     _context = context;
 }
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public GetListPhieuCongTacByCriteriaBiz(ContextDto context) : base(context)
 {
 }
예제 #18
0
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public GetListTamUngByCriteraBiz(ContextDto context) : base(context)
        {

        }
예제 #19
0
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public UpdateXoaQuanLyHopDongBiz(ContextDto context)
 {
     _context = context;
 }
예제 #20
0
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public GetListBangLuongCaNhanByCriteriaBiz(ContextDto context) : base(context)
 {
 }
예제 #21
0
        // ReSharper disable once UnusedParameter.Local
        private void FullFwAssertValid(ContextDto context, ErrorDto _)
        {
            context.Should().NotBeNull();

            FullFwAssertValid(context.Request);
        }
예제 #22
0
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public GetListNghiPhepByCriteriaDac(ContextDto context) : base(context.dbQLNSConnection)
        {
            OrmConfiguration.DefaultDialect = SqlDialect.MsSql;

            _context = context;
        }
예제 #23
0
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public DeleteHocVanBiz(ContextDto context) : base(context)
 {
 }
예제 #24
0
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public GetListKhachHangByProjectionDac(ContextDto context) : base(context.dbQLNSConnection)
        {
            OrmConfiguration.DefaultDialect = SqlDialect.MsSql;

            _context = context;
        }
예제 #25
0
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public UpdateXoaListKhoNhomHangHoaDac(ContextDto context) : base(context.dbQLNSConnection)
        {
            OrmConfiguration.DefaultDialect = SqlDialect.MsSql;

            _context = context;
        }
예제 #26
0
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public GetListPhepNamByNhanVienIdDac(ContextDto context) : base(context.dbQLNSConnection)
        {
            OrmConfiguration.DefaultDialect = SqlDialect.MsSql;

            _context = context;
        }
예제 #27
0
        public async Task <ActionResultDto> Execute(ContextDto context)
        {
            var result = new ActionResultDto();

            try
            {
                var _draw   = Protector.Int(draw);
                var _start  = Protector.Int(start);
                var _length = Protector.Int(length);

                /* =========================
                 * fixed input
                 * ========================= */
                sortName = string.IsNullOrEmpty(sortName) ? "HangHoaId" : sortName;
                sortDir  = string.IsNullOrEmpty(sortDir) ? "asc" : sortDir;
                _length  = _length < 1 ? 10 : _length;
                fields   = string.IsNullOrEmpty(fields) ? "*" : fields;
                var orderClause = sortName + " " + sortDir;
                var total       = 0;
                IEnumerable <dynamic> listHangHoa;
                if (loai == "1")
                {
                    GetListKhoHangHoaPopDMByCriteriaBiz biz = new GetListKhoHangHoaPopDMByCriteriaBiz(context);
                    biz.SearchString = search;
                    biz.FieldsField  = fields;
                    biz.OrderClause  = orderClause;
                    biz.Skip         = _start;
                    biz.Take         = _length;
                    biz.KhoId        = Protector.String(khoId);
                    biz.LeftJoinHH   = Protector.String(leftjoinHH);
                    listHangHoa      = await biz.Execute();
                }
                else
                {
                    GetListKhoHangHoaPopByCriteriaBiz biz = new GetListKhoHangHoaPopByCriteriaBiz(context);
                    biz.SearchString = search;
                    biz.FieldsField  = fields;
                    biz.OrderClause  = orderClause;
                    biz.Skip         = _start;
                    biz.Take         = _length;
                    listHangHoa      = await biz.Execute();
                }
                if (listHangHoa.Count() > 0)
                {
                    var obj = listHangHoa.FirstOrDefault();

                    total = Protector.Int(obj.MAXCNT);
                }

                dynamic _metaData = new System.Dynamic.ExpandoObject();
                _metaData.draw  = _draw;
                _metaData.total = total;

                return(ActionHelper.returnActionResult(HttpStatusCode.OK, listHangHoa, _metaData));
            }
            catch (Exception ex)
            {
                result.ReturnCode = HttpStatusCode.InternalServerError;
                result.ReturnData = new
                {
                    error = new
                    {
                        code    = HttpStatusCode.InternalServerError,
                        type    = HttpStatusCode.InternalServerError.ToString(),
                        message = ex.InnerException != null ? ex.InnerException.Message : ex.Message
                    }
                };
                return(result);
            }
        }
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public DeleteListChiTietByPhieuXuatIdDac(ContextDto context) : base(context.dbQLNSConnection)
        {
            OrmConfiguration.DefaultDialect = SqlDialect.MsSql;

            _context = context;
        }
        /// <summary>
        /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
        /// </summary>
        /// <param name="context"></param>
        public GetListAutoKhoPhieuSeriesBySoPhieuDac(ContextDto context) : base(context.dbQLNSConnection)
        {
            OrmConfiguration.DefaultDialect = SqlDialect.MsSql;

            _context = context;
        }
예제 #30
0
 /// <summary>
 /// Ham khoi tao, chi nhan vao bien moi truong va goi lop base
 /// </summary>
 /// <param name="context"></param>
 public UpdateChucVuBiz(ContextDto context) : base(context)
 {
 }