Ejemplo n.º 1
0
 /// <summary>
 /// 插入地址
 /// </summary>
 /// <param name="address">地址</param>
 /// <returns>地址编号</returns>未测试
 public int InsertAddress(Address address)
 {
     #region
     try
     {
         using (var dbcontext = new asimsContext())
         {
             dbcontext.Add(address);
             return(address.Ano);
         }
     }
     catch
     {
         return(-1);
     }
     #endregion
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 添加员工
 /// </summary>
 /// <param name="staff">员工</param>
 /// <returns></returns>未测试
 public bool AddStaff(Staff staff)
 {
     #region
     try
     {
         using (var dbcontext = new asimsContext())
         {
             dbcontext.Add(staff);
             dbcontext.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
     #endregion
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 提交订单
 /// </summary>
 /// <param name="id">用户id</param>
 /// <param name="market">订单</param>
 /// <returns></returns>未测试
 public bool SubmitOrder(string id, Market market)
 {
     #region
     try
     {
         using (var dbcontext = new asimsContext())
         {
             market.Uphone = id;
             dbcontext.Add(market);
             dbcontext.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
     #endregion
 }