当前位置: 首页>>代码示例>>C#>>正文


C# BizContext类代码示例

本文整理汇总了C#中BizContext的典型用法代码示例。如果您正苦于以下问题:C# BizContext类的具体用法?C# BizContext怎么用?C# BizContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BizContext类属于命名空间,在下文中一共展示了BizContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DisplayFirmInformation

        public JsonResult DisplayFirmInformation()
        {
            var Value = "";

            try
            {
                BizContext = (BizContext)Session["GBAdminBizContext"];
                int id = Convert.ToInt32(BizContext.FirmID);
                Session["GBAdminBizContext"] = BizContext;
                FirmInformationRepository objupdate = new FirmInformationRepository();
                var i = objupdate.GetFirmInfo(id);
                Value = Convert.ToString(i);
            }
            catch(Exception ex)
            {
                string hostName1 = Dns.GetHostName();
                string GetUserIPAddress = Dns.GetHostByName(hostName1).AddressList[0].ToString();
                string PageName = Convert.ToString(Session["PageName"]);
                //string GetUserIPAddress = GetUserIPAddress1();
                using (BaseRepository baseRepo = new BaseRepository())
                {
                    //BizContext BizContext1 = new BizContext();
                    BizApplication.AddError(baseRepo.BizDB, PageName, ex.Message, ex.StackTrace, DateTime.Now, GetUserIPAddress);
                }
                Session["PageName"] = "";
                string error = ErrorHandling.HandleException(ex);
                return this.Json(new DataSourceResult { Errors = error });
            }

            return Json(Value, JsonRequestBehavior.AllowGet);
        }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:31,代码来源:FirmInformationController.cs

示例2: FirmInformation

        public ActionResult FirmInformation()
        {
            Session["PageName"] = "Finance";
            try
            {
                BizContext = (BizContext)Session["GBAdminBizContext"];
                int id = Convert.ToInt32(BizContext.FirmID);
                Session["GBAdminBizContext"] = BizContext;
                //  long id = 100003;

                FirmInformationRepository objupdate = new FirmInformationRepository();
                var Firm = objupdate.GetFirmInfo(id).FirstOrDefault(f => f.ID == id);
                SecurityUtils.SetGlobalViewbags(this, ActiveMenu, BizContext.UserContext.IsAdmin(), BizContext.UserContext.IsHotelAdmin(), BizContext.HotelID);
                return View(Firm);
            }
            catch(Exception ex)
            {
                string hostName1 = Dns.GetHostName();
                string GetUserIPAddress = Dns.GetHostByName(hostName1).AddressList[0].ToString();
                string PageName = Convert.ToString(Session["PageName"]);
                //string GetUserIPAddress = GetUserIPAddress1();
                using (BaseRepository baseRepo = new BaseRepository())
                {
                    //BizContext BizContext1 = new BizContext();
                    BizApplication.AddError(baseRepo.BizDB, PageName, ex.Message, ex.StackTrace, DateTime.Now, GetUserIPAddress);
                }
                Session["PageName"] = "";
                string error = ErrorHandling.HandleException(ex);
                return this.Json(new DataSourceResult { Errors = error });
            }
        }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:31,代码来源:FirmInformationController.cs

示例3: DailyPropertyStatistics

        public JsonResult DailyPropertyStatistics(string HitCountPeriodID, string StartDate, string EndDate)
        {
            //DateTime dt = DateTime.ParseExact(StartDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            //DateTime dt1 = DateTime.ParseExact(EndDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            //string Datefromm = Convert.ToString(dt);
            //string Datetoo = Convert.ToString(dt1);
            //string Datefromm = dt.ToString("yyyy-MM-dd");
            //string Datetoo = dt1.ToString("yyyy-MM-dd");
            string startdate = dateconvert(StartDate);
            string Enddate = dateconvert(EndDate);
            var PartID = "1";
            //string HotelID = Convert.ToString(Session["GBAdminBizContext"]);
            BizContext = (BizContext)Session["GBAdminBizContext"];
            int HotelID = BizContext.HotelID;
            Session["GBAdminBizContext"] = BizContext;

            DataTable dts = new DataTable();
            PropertyStatisticsRepository objupdate = new PropertyStatisticsRepository();
            List<PropertyStatisticsExt> list = new List<PropertyStatisticsExt>();
            try{
            dts = objupdate.DisplaydatewisePropertyStatistics(PartID, HitCountPeriodID, startdate, Enddate, HotelID);
            if (dts != null)
            {
                if (dts.Rows.Count > 0)
                {
                    foreach (DataRow dr in dts.Rows)
                    {
                        PropertyStatisticsExt FirmObj = new PropertyStatisticsExt();
                        FirmObj.PartID = dr["PartID"].ToString();
                        FirmObj.RecordID = dr["RecordID"].ToString();
                        FirmObj.ReservationCount = dr["ReservationCount"].ToString();
                        FirmObj.Date = dr["Date"].ToString();
                        FirmObj.HitCount = dr["HitCount"].ToString();
                        FirmObj.Month = dr["Month"].ToString();
                        FirmObj.MonthName = dr["MonthName"].ToString();
                        FirmObj.Day = dr["Day"].ToString();
                        FirmObj.DayName = dr["DayName"].ToString();
                        list.Add(FirmObj);
                    }
                }
            }
            }
            catch (Exception ex)
               {
               string hostName1 = Dns.GetHostName();
               string GetUserIPAddress = Dns.GetHostByName(hostName1).AddressList[0].ToString();
               string PageName = Convert.ToString(Session["PageName"]);
               //string GetUserIPAddress = GetUserIPAddress1();
               using (BaseRepository baseRepo = new BaseRepository())
               {
                   //BizContext BizContext1 = new BizContext();
                   BizApplication.AddError(baseRepo.BizDB, PageName, ex.Message, ex.StackTrace, DateTime.Now, GetUserIPAddress);
               }
               Session["PageName"] = "";
               string error = ErrorHandling.HandleException(ex);
               return this.Json(new DataSourceResult { Errors = error });
               }
            return Json(list, JsonRequestBehavior.AllowGet);
        }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:59,代码来源:PropertyStatisticsController.cs

示例4: GetAccomodationByID

 public JsonResult GetAccomodationByID()
 {
     BizContext = (BizContext)Session["GBAdminBizContext"];
      int id = BizContext.HotelAccommodationTypeID;
      Session["GBAdminBizContext"] = BizContext;
      DropDownListsRepository model = new DropDownListsRepository();
      return Json(model.GetTypeHotelAccommodationByID(id).OrderBy(o => o.Name).Select(c => new { ID = c.ID, Name = c.Name }).OrderBy(o => o.Name), JsonRequestBehavior.AllowGet);
 }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:8,代码来源:DropDownListsController.cs

示例5: AssignBizContext

 public void AssignBizContext()
 {
     if (Session["GBAdminBizContext"] != null)
     {
         BizContext = (BizContext)Session["GBAdminBizContext"];
     }
     Session["GBAdminBizContext"] = BizContext;
 }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:8,代码来源:PromotionsController.cs

示例6: GetReviews1

        public JsonResult GetReviews1()
        {
            BizContext = (BizContext)Session["GBAdminBizContext"];
            int HotelID = BizContext.HotelID; ;
            int HotelID1 = Convert.ToInt32(Session["HotelID"]);
            PropertyReviewRepository modelRepo = new PropertyReviewRepository();

            var PropertyReviews = modelRepo.GetReviews1(HotelID);

            return Json(PropertyReviews, JsonRequestBehavior.AllowGet);
        }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:11,代码来源:PropertyReviewsController.cs

示例7: Initialize

        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            //  string CurrentCulture_TwoLetter = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
            if (requestContext.HttpContext.Session["GBAdminBizContext"] != null)
            {
                BizContext = (BizContext)requestContext.HttpContext.Session["GBAdminBizContext"];
            }
            //string Nameax = ReturnSyatemCulture();
            string SelectedLanguage = "en-Gb";
            if (BizContext.SystemCultureCode != null)
            {
                SelectedLanguage = BizContext.SystemCultureCode;
            }

            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo(SelectedLanguage);
            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(SelectedLanguage);

            base.Initialize(requestContext);

            if (SelectedLanguage != "en-Gb")
            {
                try
                {
                    CultureInfo TempCulture = (CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
                    TempCulture.DateTimeFormat.Calendar = System.Globalization.CultureInfo.GetCultureInfo("en-Gb").DateTimeFormat.Calendar;
                    TempCulture.NumberFormat.NumberDecimalSeparator = ".";
                    System.Threading.Thread.CurrentThread.CurrentCulture = TempCulture;
                    CultureInfo TempCulture1 = (CultureInfo)System.Threading.Thread.CurrentThread.CurrentUICulture.Clone();
                    TempCulture1.DateTimeFormat.Calendar = System.Globalization.CultureInfo.GetCultureInfo("en-Gb").DateTimeFormat.Calendar;
                    TempCulture1.NumberFormat.NumberDecimalSeparator = ".";
                    System.Threading.Thread.CurrentThread.CurrentUICulture = TempCulture1;
                }
                catch
                {
                }

                //base.Initialize(requestContext);
            }
        }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:39,代码来源:PropertyReviewsController.cs

示例8: SaveRoomAvailabilityAndRate

        public JsonResult SaveRoomAvailabilityAndRate(string StartDate, string Enddate, string RoomType, string PricePolicy, string AccommodationType, string WeekDay,
            string DateIDArray,string WeekDayIDArray,string SinglePriceNameArray,string DoublePriceNameArray,string RoomPriceNameArray,
            string AvailableRoomCountNameArray, string MinimumStayNameArray, string CloseToArrivalArray, string CloseToDepartureArray, string ClosedArray)
        {
            int i = 1;
            int RoomID = Convert.ToInt32(RoomType);
            BizContext = (BizContext)Session["GBAdminBizContext"];
            int Hotelid = BizContext.HotelID;
            long UserSessionID= Convert.ToInt64(BizContext.UserSessionID);
            Session["GBAdminBizContext"] = BizContext;
            RoomAvailabilityAndRateRepository ObjRep = new RoomAvailabilityAndRateRepository();
            try {
            var HotelRooms = ObjRep.GetHotelRooms(Hotelid).FirstOrDefault(f => f.RoomID == RoomID);
            int MaximamPeopleCount = GetMaximamPeopleCount(HotelRooms);
            ObjRep.CreateHotelRoomAvailability(RoomType, StartDate, Enddate, HotelRooms);
            ObjRep.CreateHotelRoomRate(RoomType, StartDate, Enddate, AccommodationType, PricePolicy);
            ObjRep.SaveRoomAvailabilityAndRate(Convert.ToInt32(AccommodationType), Convert.ToInt32(PricePolicy), Convert.ToInt32(RoomType), MaximamPeopleCount,
                DateIDArray, SinglePriceNameArray, DoublePriceNameArray, RoomPriceNameArray, AvailableRoomCountNameArray, MinimumStayNameArray,
                CloseToArrivalArray, CloseToDepartureArray, ClosedArray,UserSessionID, this);

            }
            catch (Exception ex)
            {
                string hostName1 = Dns.GetHostName();
                string GetUserIPAddress = Dns.GetHostByName(hostName1).AddressList[0].ToString();
                string PageName = Convert.ToString(Session["PageName"]);
                //string GetUserIPAddress = GetUserIPAddress1();
                using (BaseRepository baseRepo = new BaseRepository())
                {
                    //BizContext BizContext1 = new BizContext();
                    BizApplication.AddError(baseRepo.BizDB, PageName, ex.Message, ex.StackTrace, DateTime.Now, GetUserIPAddress);
                }
                Session["PageName"] = "";
                string error = ErrorHandling.HandleException(ex);
                return this.Json(new DataSourceResult { Errors = error });
            }
            return Json(i, JsonRequestBehavior.AllowGet);
        }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:38,代码来源:RoomRateAndAvailabilityController.cs

示例9: updatepassword

        //
        // POST: /Account/LogOn
        //public string Decrypt128New(string Pass)
        //{
        //    //  string EncryptionKey = "MAKV2SPBNI99212";
        //    byte[] cipherBytes = Convert.FromBase64String(Pass);
        //    using (Aes encryptor = Aes.Create())
        //    {
        //        encryptor.Key = Encoding.UTF8.GetBytes("2428598755421637");
        //        encryptor.IV = Encoding.UTF8.GetBytes("5369523205842148");
        //        using (MemoryStream ms = new MemoryStream())
        //        {
        //            using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write))
        //            {
        //                cs.Write(cipherBytes, 0, cipherBytes.Length);
        //                cs.Close();
        //            }
        //            Pass = Encoding.Unicode.GetString(ms.ToArray());
        //        }
        //    }
        //    return Pass;
        //}
        //public string Encrypt(string clearText)
        //{
        //    byte[] clearBytes = Encoding.Unicode.GetBytes(clearText);
        //    using (Aes encryptor = Aes.Create())
        //    {
        //        encryptor.Key = Encoding.UTF8.GetBytes("2428598755421637");
        //        encryptor.IV = Encoding.UTF8.GetBytes("5369523205842148");
        //        using (MemoryStream ms = new MemoryStream())
        //        {
        //            using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write))
        //            {
        //                cs.Write(clearBytes, 0, clearBytes.Length);
        //                cs.Close();
        //            }
        //            clearText = Convert.ToBase64String(ms.ToArray());
        //        }
        //    }
        //    return clearText;
        //}
        //public ActionResult LogOn(LogOnModel model, string returnUrl, FormCollection formcollection)
        //{
        //    // Decrypt128New("M5z8bP0bD/auyD/1wfthvCCkrr6q+quBRRRcyTGBh5c=");
        //    Home obj = new Home();
        //    ViewBag.AllCulture = obj.GetCulturecode();
        //    RemoveUserfromSession();
        //    string Msg = "";
        //    //Set Application Header with Application Type + Version and Build Date
        //    //  Session["ApplicationHeader"] = SecurityUtils.ApplicationHeader;
        //    if (returnUrl != null)
        //        if (returnUrl.Contains("%2f"))
        //            returnUrl = Server.UrlDecode(returnUrl);
        //    bool locked = false;
        //    //string kjhgkhjk = model.Language;
        //    bool val = true;
        //    if (ModelState.IsValid)
        //    {
        //        if (ValidateUser(model.UserName, model.Password, model.Language, ref locked, ref Msg))
        //        {
        //            if (!locked)
        //            {
        //                FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
        //                return RedirectToAction("Index", "Home");
        //            }
        //            else
        //            {
        //                ModelState.AddModelError("", "Your cannot log on the System, because your status is Locked. Please contact your Department Administrator.");
        //            }
        //        }
        //        else
        //        {
        //            ModelState.AddModelError("", Msg);
        //        }
        //    }
        //    // If we got this far, something failed, redisplay form
        //    return View(model);
        //}
        public ActionResult updatepassword(string Language, string UserName, string Password)
        {
            string status = "false";
            bool locked = false;
            string Msg = "";

            string ReminduserID = Convert.ToString(Session["RemindUserid"]);
            using (BaseRepository baseRepo = new BaseRepository())
            {
                bool RememberMe = true;
                BizContext BizContext = new BizContext();
                BizUser.UnlockUser(baseRepo.BizDB, "", UserName);
                BizUser.UpdateUserPassword(baseRepo.BizDB, ReminduserID, (new BizCrypto.AES128()).Encrypt(Password));
                if (ValidateUser(UserName, Password, Language, ref locked, ref Msg))
                {
                    if (!locked)
                    {
                        FormsAuthentication.SetAuthCookie(UserName, RememberMe);

                        //return RedirectToAction("Index", "Home");
                    }

//.........这里部分代码省略.........
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:101,代码来源:AccountController.cs

示例10: LogOn

        public ActionResult LogOn(LogOnModel model, string returnUrl, FormCollection formcollection)
        {
            // Decrypt128New("M5z8bP0bD/auyD/1wfthvCCkrr6q+quBRRRcyTGBh5c=");

            Home obj = new Home();

            ViewBag.AllCulture = obj.GetCulturecode();

            RemoveUserfromSession();
            string Msg = "";
            //Set Application Header with Application Type + Version and Build Date
            //  Session["ApplicationHeader"] = SecurityUtils.ApplicationHeader;
            if (returnUrl != null)
                if (returnUrl.Contains("%2f"))
                    returnUrl = Server.UrlDecode(returnUrl);
            bool locked = false;

            //string kjhgkhjk = model.Language;
            bool val = true;
            if (Request.QueryString["RemindCode"] != null)
            {
                string userID = "";
                string userName = "";
                string RemindCode = BizUtil.DecryptQueryStringParam(Request.QueryString["RemindCode"], ref val, true);
                bool checkDate = false;
                string[] tokens = RemindCode.Split(';');
                if (tokens.Length >= 3)
                {
                    userID = tokens[0];
                    userName = tokens[1];

                }

                if (RemindCode != "")
                {
                    using (BaseRepository baseRepo = new BaseRepository())
                    {
                        if (model.Password == model.ConfirmPassword)
                        {
                            BizContext BizContext = new BizContext();
                            if (userName != "" )
                            {
                                BizUser.UnlockUser(baseRepo.BizDB, "", userName);
                            }

                            BizUser.UpdateUserPassword(baseRepo.BizDB, userID, (new BizCrypto.AES128()).Encrypt(model.Password));
                            if (ValidateUser(model.UserName, model.Password, model.Language, ref locked, ref Msg))
                            {
                                if (!locked)
                                {
                                    FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
                                    return RedirectToAction("Index", "Home");
                                }
                                else
                                {
                                    ModelState.AddModelError("", "Your cannot log on the System, because your status is Locked. Please contact your Department Administrator.");
                                }
                            }
                        }
                        else
                        {
                            ModelState.AddModelError("", Msg);
                        }
                    }
                }
            }

            if (ModelState.IsValid)
            {
                if (ValidateUser(model.UserName, model.Password, model.Language, ref locked, ref Msg))
                {
                    if (!locked)
                    {

                        FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);

                        return RedirectToAction("Index", "Home");
                    }
                    else
                    {
                        ModelState.AddModelError("", "Your cannot log on the System, because your status is Locked. Please contact your Department Administrator.");
                    }
                }
                else
                {
                    ModelState.AddModelError("", Msg);
                }
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:92,代码来源:AccountController.cs

示例11: GetCultureByIpaddress

        public void GetCultureByIpaddress(string UserIP)
        {
            //UserIP = "5.11.79.255";
            using (BaseRepository baseRepo = new BaseRepository())
            {
                BizContext BizContext = new BizContext();
                try
                {

                    try
                    {
                        string url = "http://freegeoip.lwan.ws/json/" + UserIP.ToString();
                        WebClient client = new WebClient();
                        string jsonstring = client.DownloadString(url);
                        dynamic dynObj = JsonConvert.DeserializeObject(jsonstring);
                        // System.Web.HttpContext.Current.Session["LocId"] = dynObj.country_code;

                        string countryCode = dynObj.country_code;
                        Session["CountryCodeFromIP"] = countryCode;

                        DataTable Cultures = new DataTable();
                        baseRepo.SQLCon.Open();
                        SqlCommand cmd = new SqlCommand("B_GetCultureAvailableCount_BizTbl_Culture_SP", baseRepo.SQLCon);
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@Culture", countryCode);
                        SqlDataAdapter da = new SqlDataAdapter(cmd);
                        da.Fill(Cultures);
                        baseRepo.SQLCon.Close();

                        if (Cultures != null)
                        {
                            if (Cultures.Rows.Count > 0)
                            {
                                foreach (DataRow dr in Cultures.Rows)
                                {

                                    if (Session["GBAdminBizContext"] != null)
                                    {
                                        BizContext = (BizContext)Session["GBAdminBizContext"];
                                    }
                                    BizContext.SystemCultureCode = dr["SystemCode"].ToString();
                                    BizContext.CultureCode = dr["CultureCode"].ToString();
                                    Session["CultureCode"] = dr["CultureCode"].ToString();
                                    Session["GBAdminBizContext"] = BizContext;
                                }
                            }
                            else
                            {
                                if (Session["GBAdminBizContext"] != null)
                                {
                                    BizContext = (BizContext)Session["GBAdminBizContext"];
                                }
                                BizContext.SystemCultureCode = "en-Gb";
                                BizContext.CultureCode = "en";
                                Session["GBAdminBizContext"] = BizContext;
                                Session["CultureCode"] = "en";
                            }
                        }

                        else
                        {
                            if (Session["GBAdminBizContext"] != null)
                            {
                                BizContext = (BizContext)Session["GBAdminBizContext"];
                            }
                            BizContext.SystemCultureCode = "en-Gb";
                            BizContext.CultureCode = "en";
                            Session["GBAdminBizContext"] = BizContext;
                            Session["CultureCode"] = "en";
                        }

                    }
                    catch
                    {
                        if (Session["GBAdminBizContext"] != null)
                        {
                            BizContext = (BizContext)Session["GBAdminBizContext"];
                        }
                        BizContext.SystemCultureCode = "en-Gb";
                        BizContext.CultureCode = "en";
                        Session["GBAdminBizContext"] = BizContext;
                        Session["CultureCode"] = "en";
                    }
                }
                catch
                {
                    string url = "http://freegeoip.net/json/" + UserIP.ToString();
                    WebClient client = new WebClient();
                    string jsonstring = client.DownloadString(url);
                    dynamic dynObj = JsonConvert.DeserializeObject(jsonstring);
                    // System.Web.HttpContext.Current.Session["LocId"] = dynObj.country_code;

                    string countryCode = dynObj.country_code;
                    Session["CountryCodeFromIP"] = countryCode;

                    DataTable Cultures = new DataTable();
                    baseRepo.SQLCon.Open();
                    SqlCommand cmd = new SqlCommand("B_GetCultureAvailableCount_BizTbl_Culture_SP", baseRepo.SQLCon);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Culture", countryCode);
//.........这里部分代码省略.........
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:101,代码来源:AccountController.cs

示例12: ValidateUser

        //*********The Following Method can be used if Authentication take place from custom users Table***********//
        public Boolean ValidateUser(string Username, string password, string UserLanguage, ref bool locked, ref string Msg)
        {
            Boolean status = false;

            using (BaseRepository baseRepo = new BaseRepository())
            {
                // BizContext bc = new BizContext();

                Business.BizTbl_User user = BizUser.GetUser(baseRepo.BizDB, string.Empty, Username, password);
                BizContext BizContext = new BizContext();
                // BizContext bc = new BizContext();
                UserContext uc = new UserContext();
                // BizApplication.GetBizContext(Username, password, CultureCode,ref bc);
                if (user != null)
                {
                    status = true;
                    BizApplication.SetUserContext(baseRepo.BizDB, ref uc, Convert.ToInt64(user.ID), CultureCode);
                    BizContext.UserContext = uc;

                        //if (uc.IsHotelAdmin()) {
                        //    System.Linq.IQueryable<Business.TB_Hotel> userHotels = BizHotel.GetHotels(baseRepo.BizDB, null, uc.FirmID, null, user.ID.ToString());
                        //    foreach (Business.TB_Hotel hotel in userHotels)
                        //    {
                        //        BizContext.Hotels.Add(hotel.ID, hotel.Name);
                        //    }
                        //    Business.TB_Hotel userHotel = userHotels.First();
                        //    BizContext.HotelID = userHotel.ID;
                        //    BizContext.HotelCountryID = userHotel.CountryID;
                        //    BizContext.HotelRegionID = Convert.ToInt64(userHotel.RegionID);
                        //    BizContext.HotelCityID = Convert.ToInt64(userHotel.CityID);
                        //    BizContext.HotelCurrencyID = Convert.ToString(userHotel.CurrencyID);
                        //   // BizContext.HotelCurrencyName = dc.GetColumn(GetCurrencies(dc, CultureCode, bc.HotelCurrencyID)(0), "Name");
                        //    BizContext.HotelAccommodationTypeID = userHotel.HotelAccommodationTypeID;
                        //    BizContext.HotelAvailabilityRateUpdate = Convert.ToBoolean(userHotel.AvailabilityRateUpdate);
                        //    BizContext.HotelRoutingName = userHotel.RoutingName;
                        //    BizContext.FirmID = Convert.ToString(userHotel.FirmID);
                        //    Session["SelectedHotelID"] = userHotel.ID;
                        //    Session["SelectedHotelName"] = userHotel.Name;
                        //}

                    if (BizContext.UserContext.IsHotelAdmin())
                    {

                       // System.Linq.IQueryable<Business.TB_Hotel> userHotels = BizHotel.GetHotels(baseRepo.BizDB, null, uc.FirmID, null, user.ID.ToString());
                        int i = 0;
                        baseRepo.SQLCon.Open();
                        DataTable dt = new DataTable();
                        SqlCommand cmd = new SqlCommand("B_Ex_GetUserHotelByUserID_TB_Hotel_SP", baseRepo.SQLCon);
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@UserID", user.ID.ToString());
                        cmd.Parameters.AddWithValue("@FirmID", uc.FirmID);
                        SqlDataAdapter sda = new SqlDataAdapter(cmd);
                        sda.Fill(dt);
                        baseRepo.SQLCon.Close();
                        foreach (DataRow hotel in dt.Rows)
                        {
                            BizContext.Hotels.Add(Convert.ToInt32(hotel["ID"]), (hotel["Name"].ToString()));
                            if (i == 0)
                            {
                                BizContext.HotelID = Convert.ToInt32(hotel["ID"]);
                                BizContext.FirmID = hotel["FirmID"].ToString();
                                BizContext.HotelAccommodationTypeID = Convert.ToInt32(hotel["HotelAccommodationTypeID"]);
                                BizContext.HotelRoutingName = hotel["Name"].ToString();
                                Session["SelectedHotelID"] = Convert.ToInt32(hotel["ID"]);
                                Session["SelectedHotelName"] = hotel["Name"].ToString();
                            }
                            i++;
                        }
                    }
                    int userCountryID = 0;
                    //if (bc.UserContext.IPAddress == string.Empty)
                    //{
                    if (Session["GBAdminBizContext"] != null)
                    {
                        BizContext = (BizContext)Session["GBAdminBizContext"];
                    }
                    Session["GBAdminBizContext"] = BizContext;

                    if (UserLanguage != "")
                    {
                        try
                        {
                            string[] words = UserLanguage.Split(',');

                            BizContext.SystemCultureCode = words[1];
                            BizContext.CultureCode = words[0];
                            Session["CultureCode"] = words[0];
                            Session["GBAdminBizContext"] = BizContext;
                        }
                        catch
                        {
                            BizContext.SystemCultureCode = "en-GB";
                            BizContext.CultureCode = "en";
                            Session["GBAdminBizContext"] = BizContext;
                            Session["CultureCode"] = "en";
                        }

                    }
                    else
//.........这里部分代码省略.........
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:101,代码来源:AccountController.cs

示例13: YearlyPropertyStatistics

        public JsonResult YearlyPropertyStatistics()
        {
            // string HotelID = Convert.ToString(Session["GBAdminBizContext"]);
            BizContext = (BizContext)Session["GBAdminBizContext"];
            int HotelID = BizContext.HotelID;
            Session["GBAdminBizContext"] = BizContext;

            var PartID = "1";

            PropertyStatisticsRepository objupdate = new PropertyStatisticsRepository();
            var yearlyPropertyStatistics = objupdate.YearlyPropertyStatistics(PartID, HotelID);
            ViewBag.yearlyPropertyStatistics = yearlyPropertyStatistics;
            return Json(yearlyPropertyStatistics, JsonRequestBehavior.AllowGet);
        }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:14,代码来源:PropertyStatisticsController.cs

示例14: MonthlyPropertyStatistics

        public JsonResult MonthlyPropertyStatistics(string Year)
        {
            //  string HotelID = Convert.ToString(Session["GBAdminBizContext"]);
            BizContext = (BizContext)Session["GBAdminBizContext"];
            int HotelID = BizContext.HotelID;
            Session["GBAdminBizContext"] = BizContext;

            var PartID = "1";
            if (Year == "")
            {
                Year = "2015";
            }
            DataTable dt = new DataTable();
            PropertyStatisticsRepository objupdate = new PropertyStatisticsRepository();
            List<PropertyStatisticsExt> list = new List<PropertyStatisticsExt>();
            try
            {
                dt = objupdate.MonthlyPropertyStatistics(PartID, HotelID, Year);
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        PropertyStatisticsExt FirmObj = new PropertyStatisticsExt();
                        FirmObj.PartID = dr["PartID"].ToString();
                        FirmObj.RecordID = dr["RecordID"].ToString();
                        FirmObj.ReservationCount = dr["ReservationCount"].ToString();
                        FirmObj.HitCount = dr["HitCount"].ToString();
                        FirmObj.MonthName = dr["MonthName"].ToString();
                        list.Add(FirmObj);
                    }
                }
            }
            catch (Exception ex)
            {
                string hostName1 = Dns.GetHostName();
                string GetUserIPAddress = Dns.GetHostByName(hostName1).AddressList[0].ToString();
                string PageName = Convert.ToString(Session["PageName"]);
                //string GetUserIPAddress = GetUserIPAddress1();
                using (BaseRepository baseRepo = new BaseRepository())
                {
                    //BizContext BizContext1 = new BizContext();
                    BizApplication.AddError(baseRepo.BizDB, PageName, ex.Message, ex.StackTrace, DateTime.Now, GetUserIPAddress);
                }
                Session["PageName"] = "";
                string error = ErrorHandling.HandleException(ex);
                return this.Json(new DataSourceResult { Errors = error });
            }
            return Json(list, JsonRequestBehavior.AllowGet);
        }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:49,代码来源:PropertyStatisticsController.cs

示例15: Initialize

        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            //  string CurrentCulture_TwoLetter = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
            if (requestContext.HttpContext.Session["GBAdminBizContext"] != null)
            {
                BizContext = (BizContext)requestContext.HttpContext.Session["GBAdminBizContext"];
            }
            //string Nameax = ReturnSyatemCulture();
            string SelectedLanguage = "en-Gb";
            if (BizContext.SystemCultureCode != null)
            {
                SelectedLanguage = BizContext.SystemCultureCode;
            }

            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo(SelectedLanguage);
            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(SelectedLanguage);

            base.Initialize(requestContext);
        }
开发者ID:tomasroy2015,项目名称:gbs-angular-html5,代码行数:19,代码来源:AccountController.cs


注:本文中的BizContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。