public ActionResult Index(int year, int month, int date)
        {
            s26webDataContext db = new s26webDataContext();
            DeliveryModel data = new DeliveryModel();

            string Session_name = Method.SessionUserId_Home;
            string account = Method.Get_Session(Session, Session_name);
            DateTime New_BabyBirthday = new DateTime(year, month, date);
            //string New_BabyBirthday = year+"/"+month+"/"+date;
            DateTime vol_BabyBirthday = db.Volunteers.FirstOrDefault(w => w.Id == int.Parse(account)).BabyBirthday;

            if (vol_BabyBirthday != New_BabyBirthday)
            {
                data.Update_BabyBirthday(account, New_BabyBirthday);
            }
            return RedirectToAction("article");
        }
        public ActionResult article(DeliveryModel.OrdersModel item)
        {
            Session.Add("Order_Id", item.Orders_ID);

            if (item.Orders_ID == 3)
            {
                Session.Add("Order_Quantity", item.Order_Quantity_3);
            }
            else if (item.Orders_ID == 6)
            {
                Session.Add("Order_Quantity", item.Order_Quantity_6);
            }
            else if (item.Orders_ID == 7)
            {
                Session.Add("Order_Quantity", item.Order_Quantity_7);
            }

            return RedirectToAction("Orders", "Delivery");
        }
        public int Insert(DeliveryModel.OrdersModel item)
        {
            s26webDataContext db = new s26webDataContext();
            try
            {
                Orders orders = new Orders
                    {
                        VolunteersId = item.VolunteersId,
                        Osid = DateTime.UtcNow.AddHours(8).ToString("yyyyMMddHHmm"),
                        ProductId = item.ProductId,
                        Order_Quantity = item.Order_Quantity,
                        TotalPrice = item.TotalPrice,
                        Name = item.Name,
                        Mobile = item.Mobile,
                        CityId = item.CityId,
                        AreaId = item.AreaId,
                        Address = item.Address,
                        SharePoint=  true,
                        Remarks = item.Remarks,
                        OrdersStates = 22,
                        OrdersTime = DateTime.UtcNow,
                        ReciveTimeChoice = 15,
                        OrdersFrom = 0,
                    };

                db.Orders.InsertOnSubmit(orders);
                db.SubmitChanges();

                Invoice invoice = new Invoice
                {
                    OrdersId = db.Orders.OrderByDescending(o => o.Id).FirstOrDefault(f => f.Id != null).Id,
                    InvoiceCategory = item.InvoiceCategory
                };

                if (item.InvoiceCategory == db.Category.FirstOrDefault(w => w.Fun_Id == 5 && w.Memo.Equals("Invoice")).Id)
                {
                    invoice.InvoiceName = item.InvoiceName;
                    invoice.InvoiceNo = item.InvoiceNo;
                }

                db.Invoice.InsertOnSubmit(invoice);
                db.SubmitChanges();
                db.Connection.Close();
                return orders.Id;

            }
            catch
            {
                return -1;
            }
        }
        public ActionResult Recipient(DeliveryModel.OrdersModel item)
        {
            DeliveryModel data = new DeliveryModel();
            string Session_name = Method.SessionUserId_Home;
            string account = Method.Get_Session(Session, Session_name);
            item.VolunteersId = int.Parse(account);
            try
            {
                if (data.Insert(item) <= 0)
                {
                    TempData["err"] = "Recipient_0";
                    return RedirectToAction("Index");
                }

            }
            catch
            {
                TempData["err"] = "Recipient_0";
            }
            return RedirectToAction("Recipient_complete");
        }
 public static string Set_Orders_Detail(DeliveryModel.OrdersModel item, HttpSessionStateBase Session)
 {
     return "";
 }