You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

60 lines
1.7 KiB

using System;
using System.Collections.Generic;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CK.SCP.Models;
using CK.SCP.Models.ScpEntity;
namespace CK.SCP.Controller
{
public class PlanMonthController
{
public static TB_PlanMonth GetPlanMonthById(int id)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
return db.TB_PlanMonth.SingleOrDefault(p => p.ID == id);
}
}
public static bool UpdatePlanMonthById(TB_PlanMonth model)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
model.IsSend = "是";
model.SendTime = DateTime.Now;
db.TB_PlanMonth.AddOrUpdate(model);
db.SaveChanges();
}
return true;
}
public static TA_VENDER GetVend()
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
return db.TA_VENDER.OrderByDescending(p => p.Email).SingleOrDefault(p => p.Email != null);
}
}
public static List<TA_VENDER> GetVendList()
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
return db.TA_VENDER.ToList();
}
}
public static bool SaveTbPlanMonth(TB_PlanMonth model)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
db.TB_PlanMonth.AddOrUpdate(model);
db.SaveChanges();
}
return true;
}
}
}