Пример #1
0
 public ActionResult Create(string group = "")
 {
     ViewBag.Selected     = "";
     ViewBag.GroupID      = group;
     ViewBag.isAuthInView = _tblSystemConfigService.GetDefault().isAuthInView;
     return(View());
 }
        public ActionResult Create(string controllername, string id)
        {
            //ViewBag
            ViewBag.DDLMenu = GetMenuList();
            //ViewBag.parentidValue = parentid;
            var systemconfig = _tblSystemConfigService.GetDefault();

            ViewBag.ISTRANSERCO = systemconfig != null ? (systemconfig.FeeName.Contains("TRANSERCO") ? true : false) : false;
            int count = _tblCustomerGroupService.CountParent();
            var obj   = new tblCustomerGroup()
            {
                Ordering = count + 1,
                Inactive = false
            };

            if (!string.IsNullOrEmpty(id))
            {
                var obj2 = _tblCustomerGroupService.GetById(Guid.Parse(id));
                if (obj2 != null)
                {
                    obj.ParentID = obj2.ParentID;
                    obj.Inactive = obj2.Inactive;
                    obj.Ordering = obj2.Ordering + 1;
                }
            }

            return(View(obj));
        }
Пример #3
0
        // GET: Parking/OrderActiveCard
        public ActionResult Index(string customergroup = "", string key = "", string cardgroup = "", string fromdate = "", string todate = "", int page = 1)
        {
            // var totalPage = 0;
            var    totalItem      = 0;
            var    pageSize       = 20;
            double totalMoney     = 0;
            var    datefrompicker = "";

            var customergroups = GetListChild("", customergroup);

            if (string.IsNullOrEmpty(fromdate))
            {
                fromdate = DateTime.Now.ToString("dd/MM/yyyy 00:00:00");
            }

            if (string.IsNullOrEmpty(todate))
            {
                todate = DateTime.Now.ToString("dd/MM/yyyy 23:59:59");
            }

            if (!string.IsNullOrWhiteSpace(fromdate) && !string.IsNullOrWhiteSpace(todate))
            {
                datefrompicker = fromdate + "-" + todate;
            }

            #region Giao diện

            var systemconfig = _tblSystemConfigService.GetDefault();

            var list = new List <OrderActiveCard>();

            if (systemconfig.FeeName.Contains("AQUA"))
            {
                list = _OrderActiveCardService.GetListOrder_v2(key, fromdate, todate, cardgroup, customergroups, page, pageSize, ref totalItem, ref totalMoney).ToList();
            }
            else
            {
                list = _OrderActiveCardService.GetListOrder(key, fromdate, todate, cardgroup, customergroups, page, pageSize, ref totalItem).ToList();
            }


            var gridModel = PageModelCustom <OrderActiveCard> .GetPage(list, page, pageSize, totalItem);

            ViewBag.keyValue              = key;
            ViewBag.cardgroupidsValue     = cardgroup;
            ViewBag.customergroupidsValue = customergroup;

            ViewBag.cardgroups     = GetListCardGroup().ToDataTableNullable();
            ViewBag.customergroups = GetMenuList();


            ViewBag.fromdateValue = fromdate;
            ViewBag.todateValue   = !string.IsNullOrWhiteSpace(todate) ? Convert.ToDateTime(todate).ToString("dd/MM/yyyy HH:mm:59") : DateTime.Now.ToString("dd/MM/yyyy 23:59:59");
            ViewBag.TotalMoney    = totalMoney;
            return(View(gridModel));

            #endregion
        }
        public ActionResult Index()
        {
            ViewBag.CardGroups     = GetCardGroup().Where(n => n.CardType == 0);
            ViewBag.CustomerGroups = GetMenuList();
            var systemconfig = _tblSystemConfigService.GetDefault();

            ViewBag.ISCOMA = systemconfig != null ? (systemconfig.FeeName.Contains("COMA6") ? true : false) : false;
            return(View());
        }
Пример #5
0
        public ActionResult IndexAdmin()
        {
            ViewBag.SystemConfigValue = _tblSystemConfigService.GetDefault();


            var list = _MenuFunctionConfigService.GetAll().ToList();

            return(View(list));
        }
        public ActionResult Create(string key = "", string customergroup = "", string customerstatus = "", int page = 1)
        {
            ViewBag.keyValue            = key;
            ViewBag.CustomerGroupValue  = customergroup;
            ViewBag.customerstatusValue = customerstatus;

            ViewBag.CustomerGroups = GetMenuList();
            var systemconfig = _tblSystemConfigService.GetDefault();

            ViewBag.IsCompartment = systemconfig != null ? systemconfig.isCompartment : true;
            return(View());
        }
        /// <summary>
        /// lấy danh sách cardgroup được phân quyền theo user
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public string GetAuthCardGroupIds()
        {
            var user   = GetCurrentUser.GetUser();
            var userid = user != null ? user.Id : "";

            string cardgroupids = "";

            if (user != null)
            {
                var objsystem = _tblSystemConfigService.GetDefault();

                if (!string.IsNullOrEmpty(userid) && objsystem != null && objsystem.isAuthInView)
                {
                    var user_auth = GetByUserId(userid);

                    if (user_auth != null && !string.IsNullOrEmpty(user_auth.CardGroupIds))
                    {
                        cardgroupids = user_auth.CardGroupIds;
                    }
                    else
                    {
                        cardgroupids = "NULL";
                    }
                }
            }

            return(cardgroupids);
        }
Пример #8
0
        public async Task <string> GetLicense()
        {
            string result = "";

            try
            {
                using (var fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + @"uploads\lic.dat", FileMode.Open, FileAccess.ReadWrite))
                {
                    using (var sr = new StreamReader(fs))
                    {
                        var feename = _tblSystemConfigService.GetDefault().FeeName;

                        var fileContent   = sr.ReadToEnd();
                        var decryptedData = CryptoProvider.SimpleDecryptWithPassword(fileContent, SecurityModel.License_Key);
                        var licData       = JsonConvert.DeserializeObject <List <MN_License> >(decryptedData);
                        var currentLic    = licData.Where(p => p.ProjectName == feename).FirstOrDefault();
                        if (currentLic != null)
                        {
                            var expireDate = DateTime.Now;
                            DateTime.TryParseExact(currentLic.ExpireDate, "dd/MM/yyyy HH:mm", CultureInfo.InvariantCulture, DateTimeStyles.None, out expireDate);

                            result = $"{currentLic.ProjectName};{currentLic.IsExpire};{expireDate.ToString("yyyy/MM/dd HH:mm")}";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }

            return(await Task.FromResult(result));
        }
Пример #9
0
        public ActionResult Index(string group = "")
        {
            ViewBag.GroupID = group;

            var obj = _tblSystemConfigService.GetDefault();

            if (obj == null)
            {
                obj = new tblSystemConfig();
                obj.SystemConfigID = Guid.NewGuid();
                obj.FeeName        = "FUTECH";
                obj.SortOrder      = 1;
                obj.DelayTime      = 0;

                _tblSystemConfigService.Create(obj);
            }

            return(View(obj));
        }
        /// <summary>
        /// In hóa đơn
        /// </summary>
        /// <returns></returns>
        public ActionResult PrintBill(string cardnumbers, string type, string id)
        {
            ViewBag.Card = cardnumbers;

            var list = new List <tblActiveCardCustomViewModel>();

            //in tại form gia hạn
            if (type == "1")
            {
                var orderid = _tblActiveCardService.GetOrderIdByCardNumbers(cardnumbers);
                //list = _tblActiveCardService.GetBill(cardnumbers);
                list = _tblActiveCardService.GetBill_v2(orderid);
            }
            else
            {
                //in tại danh sách biên lai
                list = _tblActiveCardService.GetBill_v2(id);
            }

            ViewBag.System = _tblSystemConfigService.GetDefault();
            return(View(list));
        }
Пример #11
0
        // GET: Parking/tblCards
        #region Danh sách thẻ
        public ActionResult Index(string key = "", string fromdate = "", string todate = "", bool desc = true, string columnquery = "ImportDate", string customerGroup = "", string isCheckByTime = "0", int page = 1, string cardgroup = "")
        {
            int pageSize  = 20;
            int totalItem = 0;
            var str       = new List <string>();

            GetListChildCustomer(str, customerGroup);

            if (string.IsNullOrWhiteSpace(fromdate))
            {
                fromdate = DateTime.Now.ToString("dd/MM/yyy");
            }
            if (string.IsNullOrWhiteSpace(todate))
            {
                todate = DateTime.Now.ToString("dd/MM/yyy");
            }
            var systemConfig = _tblSystemConfigService.GetDefault();
            var list         = _itblCardService.GetAllCartPagingByFirstTSQL(key, fromdate, desc, columnquery, todate, cardgroup, str, isCheckByTime, page, pageSize, ref totalItem);


            var girdMode = PageModelCustom <tblCardCustomViewModel> .GetPage(list, page, pageSize, totalItem);

            //if (systemConfig.FeeName.Contains("TRANSERCO"))
            //{
            //    ViewBag.ListMoney = _itblCardService.GetMoneyByCardNumber();
            //}
            ViewBag.ListMoney = _itblCardService.GetMoneyByCardNumber();
            // ViewBag.System = systemConfig;
            //ViewBag.fromDate = fromdate;
            //ViewBag.toDate = !string.IsNullOrWhiteSpace(todate) ? Convert.ToDateTime(todate).ToString("dd/MM/yyyy HH:mm:59") : DateTime.Now.ToString("dd/MM/yyyy 23:59:59");
            ViewBag.fromdateValue      = fromdate;
            ViewBag.todateValue        = todate;
            ViewBag.KeyWord            = key;
            ViewBag.GroupCustomers     = GetMenuList();
            ViewBag.CustomerId         = customerGroup;
            ViewBag.CardGroupDT        = GetListCardGroups().ToDataTableNullable();
            ViewBag.CardGroupid        = cardgroup;
            ViewBag.isCheckByTimeValue = isCheckByTime;
            ViewBag.ColumnQuery        = columnquery;
            ViewBag.Desc = desc;
            // ViewBag.ISTRANSERCO = systemConfig != null ? (systemConfig.FeeName.Contains("TRANSERCO") ? true : false) : false;
            return(View(girdMode));
        }
 public tblSystemConfig Get()
 {
     return(_tblSystemConfigService.GetDefault());
 }
Пример #13
0
        private byte[] PK_CardCustomerFormatCell2(List <tblCardExcel> listData, string filename = "", string sheetname = "", string comments = "", string titleSheet = "", string titleTime = "")
        {
            var Dictionary       = FunctionHelper.GetLocalizeDictionary("tblCard", "Index");
            var DictionaryAction = FunctionHelper.GetLocalizeDictionary("report", "reportSearch");

            //Nội dung đầu trang
            //var user = GetCurrentUser.GetUser();
            var user = new User()
            {
                Name = "APP"
            };
            var timeSearch = "";

            if (!string.IsNullOrWhiteSpace(titleTime))
            {
                timeSearch = DictionaryAction["fromDate"] + ": " + titleTime.Split(new[] { '-' })[0] + " - " + DictionaryAction["toDate"] + ": " + titleTime.Split(new[] { '-' })[1];
            }

            var dtHeader     = _tblSystemConfigService.getHeaderExcel(titleSheet, timeSearch, user.Username);
            var systemconfig = _tblSystemConfigService.GetDefault();
            //Header
            var listColumn = new List <SelectListModel>();

            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["NumberRow"], ItemValue = "NumberRow"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["CardNo"], ItemValue = "CardNo"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["CardNumber"], ItemValue = "CardNumber"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["CardGroup"], ItemValue = "CardGroupNumber"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["ExpireDate"], ItemValue = "DateExpire"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["Plate"], ItemValue = "Plates"
            });

            if (systemconfig != null && systemconfig.FeeName.Contains("TRANSERCO"))
            {
                listColumn.Add(new SelectListModel {
                    ItemText = Dictionary["ContractCode"], ItemValue = "Description"
                });
            }

            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["VehicleNames"], ItemValue = "VehicleNames"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["CustomerCode"], ItemValue = "CustomerCode"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["CustomerName"], ItemValue = "CustomerName"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["CustomerGroupName"], ItemValue = "CustomerGroupName"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["IdentityCard"], ItemValue = "CMT"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["phone"], ItemValue = "SĐT"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["add"], ItemValue = "Address"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["Inactive"], ItemValue = "Inactive"
            });
            listColumn.Add(new SelectListModel {
                ItemText = Dictionary["DateCreated"], ItemValue = "DateCreated"
            });

            //Chuyển dữ liệu về datatable
            DataTable dt = listData.ToDataTableNullable();

            if (systemconfig != null && !systemconfig.FeeName.Contains("TRANSERCO"))
            {
                dt.Columns.Remove("Description");
            }
            //Xuất file
            return(GetByte(dt, listColumn, dtHeader, filename, sheetname, comments));
        }
Пример #14
0
 public ActionResult Index()
 {
     updatetblUserToUser();
     ViewBag.System = _tblSystemConfigService.GetDefault();
     return(View());
 }