//
 public int AddUser_DrinkCostSerialList(string SerialNumber, string IcCardNo, string CostTime, string DeviceCode, string CostFee, string RunningWaterLitre, string CurrentUserBalance)
 {
     int count = 0;
     using (var ctx = new MultimediaSYSEntities())
     {
         var DrinkCostSeria_tmp = new jjj_user_DrinkCostSerialList { SerialNumber = SerialNumber, IcCardNo = IcCardNo, CostTime = Convert.ToDateTime(CostTime), DeviceCode = DeviceCode, CostFee = Convert.ToDecimal(CostFee), RunningWaterLitre = Convert.ToDecimal(RunningWaterLitre), CurrentUserBalance = Convert.ToDecimal(CurrentUserBalance) };
         ctx.jjj_user_DrinkCostSerialList.Add(DrinkCostSeria_tmp);
         count = ctx.SaveChanges();
     }
     return count;
 }
 //
 /// <summary>
 /// 添加一条用户基础信息
 /// </summary>
 /// <param name="usernameTmp"></param>
 /// <param name="passwordTmp"></param>
 /// <param name="phoneTmp"></param>
 /// <param name="isEnableTmp"></param>
 public int AddUserInfo1(string usernameTmp, string passwordTmp, string phoneTmp, int isEnableTmp)
 {
     int count = 0;
     using (var ctx = new MultimediaSYSEntities())
     {
         var userinfo_tmp = new jjj_users { username = usernameTmp, password = passwordTmp, phone = phoneTmp, isEnable = isEnableTmp };
         ctx.jjj_users.Add(userinfo_tmp);
         count = ctx.SaveChanges();
     }
     return count;
 }
 public int DeleteUserInfo1(int uidTmp)
 {
     int count = 0;
     using (var ctx = new MultimediaSYSEntities())
     {
         var query = from a in ctx.jjj_users
                     where a.uid == uidTmp
                     select a;
         foreach (var item in query)
         {
             ctx.jjj_users.Remove(item);
         }
         count = ctx.SaveChanges();
     }
     return count;
 }
 public int UpdateUserPassword1(int uidTmp, string passwordTmp)
 {
     int count = 0;
     using (var ctx = new MultimediaSYSEntities())
     {
         var query = from a in ctx.jjj_users
                     where a.uid == uidTmp
                     select a;
         foreach (var item in query)
         {
             item.password = passwordTmp;
         }
         count = ctx.SaveChanges();
     }
     return count;
 }
 public int UpdateTerminalEquipmentSerialCommand2(int TerSerialCommandID, int SendStatus)
 {
     int count = 0;
     using (var ctx = new MultimediaSYSEntities())
     {
         var query = from a in ctx.jjj_TerminalEquipmentSerialCommand
                     where a.TerSerialCommandID == TerSerialCommandID
                     select a;
         foreach (var item in query)
         {
             item.SendStatus = SendStatus;
         }
         count = ctx.SaveChanges();
     }
     return count;
 }
 public int UpdateTerminalEquipmentInfo3(int TerminalEquipmentIDTmp, int IsSendTmp)
 {
     int count = 0;
     using (var ctx = new MultimediaSYSEntities())
     {
         var query = from a in ctx.jjj_TerminalEquipmentList
                     where a.TerminalEquipmentID == TerminalEquipmentIDTmp
                     select a;
         foreach (var item in query)
         {
             item.IsSend = IsSendTmp;
         }
         count = ctx.SaveChanges();
     }
     return count;
 }
 public int UpdateTerminalEquipmentInfo2(string sessionIDTmp)
 {
     int count = 0;
     using (var ctx = new MultimediaSYSEntities())
     {
         var query = from a in ctx.jjj_TerminalEquipmentList
                     where a.SessionId == sessionIDTmp
                     select a;
         foreach (var item in query)
         {
             item.TerminalStatus = 0;
         }
         count = ctx.SaveChanges();
     }
     return count;
 }
 //
 public int Updatejjj_TerminalSwitchScreenTime1(int TerminalEquipmentID, int IsSend)
 {
     int count = 0;
     using (var ctx = new MultimediaSYSEntities())
     {
         var query = from a in ctx.jjj_TerminalSwitchScreenTime
                     where a.TerminalEquipmentID == TerminalEquipmentID
                     select a;
         foreach (var item in query)
         {
             item.UpdateTime = DateTime.Now;
             item.IsSend = IsSend;
         }
         count = ctx.SaveChanges();
     }
     return count;
 }
 public int Updatejjj_ProgramSendSerialList3(int ProgramSendSerialID, int SendStatus, Nullable<DateTime> DownloadOverTime)
 {
     int count = 0;
     using (var ctx = new MultimediaSYSEntities())
     {
         var query = from a in ctx.jjj_ProgramSendSerialList
                     where a.ProgramSendSerialID == ProgramSendSerialID
                     select a;
         foreach (var item in query)
         {
             item.SendStatus = SendStatus;
             item.DownloadOverTime = DownloadOverTime;
         }
         count = ctx.SaveChanges();
     }
     return count;
 }
 public int Updatejjj_ProgramSendSerialList1(int ProgramSendSerialID, int SendStatus)
 {
     int count = 0;
     using (var ctx = new MultimediaSYSEntities())
     {
         var query = from a in ctx.jjj_ProgramSendSerialList
                     where a.ProgramSendSerialID == ProgramSendSerialID
                     select a;
         foreach (var item in query)
         {
             item.SendStatus = SendStatus;
         }
         count = ctx.SaveChanges();
     }
     return count;
 }