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


C# Models.s26webDataContext类代码示例

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


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

示例1: Sale_SMS

        public static MobileModel Sale_SMS(int Id, String mobile, int collected, DateTime ExcTime, string detail = null)
        {
            s26webDataContext db = new s26webDataContext();
            IntroductionModel intro = new IntroductionModel();
            var msg = intro.Get_One(Id);
            var data = db.Volunteers.FirstOrDefault(f => f.Mobile == mobile);

            /////////////////////
            msg.Content = msg.Content.Replace("<--end_time-->", ExcTime.AddHours(8).ToString("yyyy/MM/dd HH:mm"));
            msg.Content = msg.Content.Replace("<--collected-->", collected.ToString());
            /////////////////////
            var mm = SMS_Send(msg, mobile);
            SMS sms = new SMS
            {
                sms_id = mm.error_code,
                content = mm.error_msg,
                CreateTime = DateTime.UtcNow,
                mobile = mobile,
                detail = detail
            };
            db.SMS.InsertOnSubmit(sms);
            db.SubmitChanges();
            db.Connection.Close();
            //return the response
            return mm;
        }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:26,代码来源:MobileAPIModel.cs

示例2: Get

 public SiteOptionShow Get()
 {
     s26webDataContext db = new s26webDataContext();
     var data = db.WebConfig.FirstOrDefault();
     db.Connection.Close();
     if (data != null)
     {
         return new SiteOptionShow
         {
             Id = data.Id,
             WebTitle = data.WebTitle,
             WebIcon = data.WebIcon,
             WebLogo = Method.RootPath + data.WebLogo,
             WebSEO = data.WebSEO,
             WebDescription = data.WebDescription,
             SMTP_Server = data.SMTP_Server,
             SMTP_Port = data.SMTP_Port,
             SMTP_Login = data.SMTP_Login,
             SMTP_SSL = data.SMTP_SSL,
             SMTP_Account = data.SMTP_Account,
             SMTP_Password = data.SMTP_Password,
             Service_Mail = data.Service_Mail,
             FromName = data.FromName,
             ExportMail = data.Export_Mail,
             OrdersMail = data.OrdersMail,
             iOS_Version = data.iOS_Version,
             Android_Version = data.Android_Version
         };
     }
     return new SiteOptionShow();
 }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:31,代码来源:SiteOptionModel.cs

示例3: Get_Data

        public List<OnlineModelShow> Get_Data(int p = 1, int take = 10)
        {
            try
            {
                s26webDataContext db = new s26webDataContext();

                var data = Get().OrderByDescending(o => o.Id).Skip((p - 1) * take).Take(take);
                foreach (var i in data)
                {
                    string[] typestr = i.Type.Split(',');
                    string list = "";
                    foreach (var j in typestr)
                    {
                        if (j != "")
                        {
                            int typeint = int.Parse(j);
                            list += db.Category.FirstOrDefault(f => f.Id == typeint).Name + ",";
                        }
                    }
                    i.Type = list;
                };

                List<OnlineModelShow> item = Convert(data.ToList());
                db.Connection.Close();
                return item;
            }
            catch { return new List<OnlineModelShow>(); }
        }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:28,代码来源:OnlineModel.cs

示例4: Get_Area_Select

        public static List<SelectListItem> Get_Area_Select(int city, int area, bool zip, bool all)
        {
            s26webDataContext db = new s26webDataContext();
            List<SelectListItem> data = new List<SelectListItem>();
            data.Add(new SelectListItem
            {
                Selected = area == 0,
                Text = all ? "全部" : "請選擇",
                Value = "0"
            });
            if (city == 0)
            {
                return data;
            }
            
                data.AddRange(db.Area.Where(w => w.City_Id == city).OrderBy(o => o.Id).ThenBy(t => t.ZipCode).Select(s =>
                    new SelectListItem
                    {
                        Selected = area == s.Id,
                        Text = (zip ? s.ZipCode : "") + s.Name,
                        Value = s.Id.ToString()
                    }));
            

            db.Connection.Close();
            return data;
        }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:27,代码来源:CityArea.cs

示例5: Get

 public IQueryable<SalesPromotion> Get()
 {
     s26webDataContext db = new s26webDataContext();
     IQueryable<SalesPromotion> data = db.SalesPromotion;
     db.Connection.Close();
     return data;
 }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:7,代码来源:SalesPromotionModel.cs

示例6: Get

 public IQueryable<Online> Get()
 {
     s26webDataContext db = new s26webDataContext();
     IQueryable<Online> data = db.Online;
     db.Connection.Close();
     return data;
 }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:7,代码来源:OnlineModel.cs

示例7: Get_Data

 public List<GiftModelShow> Get_Data()
 {
     s26webDataContext db = new s26webDataContext();
     var gift = Convert(db.Gift.OrderByDescending(o => o.Id).ToList());
     foreach(var i in gift)
     {
         string[] typestr= i.MemberType.Split(',');
         string list = "";
         string item = "";
         foreach(var j in typestr)
         {
         if (j != "") 
         {
             int typeint = int.Parse(j);
             
             if(typeint == 1)
             { item = "懷孕中"; }
             else if (typeint == 2)
             { item = "使用S-26產品"; }
             else if (typeint == 3)
             { item = "全母乳餵哺"; }
             else if (typeint == 4)
             { item = "其他"; }
             
             //list += db.Category.FirstOrDefault(f => f.Id == typeint).Name + ",";
         }
         list += item + ",";
         }
         i.MemberType = list;
     };
     db.Connection.Close();
     return gift;
 }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:33,代码来源:GiftModel.cs

示例8: Get_MemberType

 public List<Category> Get_MemberType()
 {
     s26webDataContext db = new s26webDataContext();
     GiftModelShow data = new GiftModelShow();
     data.membertype_list = db.Category.Where(w => w.Fun_Id == 2).ToList();
     db.Connection.Close();
     return data.membertype_list;
 }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:8,代码来源:GiftModel.cs

示例9: Get_Category

 public List<Category> Get_Category()
 {
         s26webDataContext db = new s26webDataContext();
         PointModelShow data = new PointModelShow();
         data.Point_Category = db.Category.Where(w => w.Fun_Id == 3).ToList();
         db.Connection.Close();
         return data.Point_Category;
 }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:8,代码来源:PointModel.cs

示例10: CheckMobile

 public ActionResult CheckMobile(string Mobile)
 {
     s26webDataContext db = new s26webDataContext();
     var result = db.Volunteers.FirstOrDefault(f => f.Mobile == Mobile);
     db.Connection.Close();
     if (result != null)
         return Json(false, JsonRequestBehavior.AllowGet);
     else
         return Json(true, JsonRequestBehavior.AllowGet);
 }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:10,代码来源:HomeController.cs

示例11: getSMSPoint

 public static int getSMSPoint()
 {
     s26web.Models.s26webDataContext db = new s26web.Models.s26webDataContext();
     int point = 0;
     var result = db.SMS.Where(w=>w.sms_id.Equals("000")).OrderByDescending(o => o.CreateTime).FirstOrDefault();
     List<string> sms_content = new List<string>();
     if(result != null)
         sms_content = result.content.Split('|').ToList();
     point = Convert.ToInt32(sms_content.LastOrDefault());
     return point;
 }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:11,代码来源:MobileAPIModel.cs

示例12: Delivery_Order

        public ActionResult Delivery_Order(string Osid, int Id)
        {
            string Session_name = Method.SessionUserId_Home;
            int memberid = int.Parse(Method.Get_Session(Session, Session_name));
            s26webDataContext db = new s26webDataContext();
            Osid = db.Orders.FirstOrDefault(f => f.Id == Id).Osid;
            db.Connection.Close();

            OrdersModel orders = new OrdersModel();
            var orderdetail = orders.Get_Detail(Osid);
            return View(orderdetail);
        }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:12,代码来源:MemberController.cs

示例13: Update

 public void Update(string[] UserName, string[] FBUrl)
 {
     s26webDataContext db = new s26webDataContext();
     for (int i = 0; i < UserName.Count(); i++)
     {
         var data = db.eCRM.FirstOrDefault(f => f.Id == (i + 1));
         data.UserName = UserName[i];
         data.FBUrl = FBUrl[i];
     }
     db.SubmitChanges();
     db.Connection.Close();
 }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:12,代码来源:CRMModel.cs

示例14: Get_Data

        public List<SalesPromotionModelShow> Get_Data(int p = 1, int take = 10)
        {
            try
            {
                s26webDataContext db = new s26webDataContext();

                var data = Get().OrderByDescending(o=>o.Id).Skip((p - 1) * take).Take(take);
                List<SalesPromotionModelShow> item = Convert(data.ToList());
                db.Connection.Close();
                return item;
            }
            catch { return new List<SalesPromotionModelShow>(); }
        }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:13,代码来源:SalesPromotionModel.cs

示例15: Index

        public ActionResult Index()//HttpSessionStateBase Session
        {
            s26webDataContext db = new s26webDataContext();
            string Session_name = Method.SessionUserId_Home;
            string account = Method.Get_Session(Session, Session_name);

            var vol = db.Volunteers.FirstOrDefault(w => w.Id == int.Parse(account));
            ViewData["Bir_year"] = vol.BabyBirthday.ToString("yyyy");
            ViewData["Bir_month"] = vol.BabyBirthday.ToString("MM");
            ViewData["Bir_date"] = vol.BabyBirthday.ToString("dd");

            return View();
        }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:13,代码来源:DeliveryController.cs


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