public int AddBsUser(BsUser bsUser) { return(bsUserDAL.AddBsUser(bsUser)); }
public int EditBsUser(BsUser bsUser) { return(bsUserDAL.EditBsUser(bsUser)); }
/// <summary> /// 新增数据 /// </summary> /// <param name="model">实体</param> /// <returns>系统编号</returns> public int Insert(BsUser model) { return(DBContext.Insert("Agent_BsUser", model) .AutoMap(x => x.SysNo) .ExecuteReturnLastId <int>("SysNo")); }
public string Get_NextDoctByDept(string json) { Back <Oudayschedule> back = new Back <Oudayschedule>(); string msg = ""; string xml = ""; try { int deptid = Convert.ToInt32(JsonHelper.GetVluesParentstr(json, "deptid")); DateTime today, endtoday, nextst, nextend; today = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")); endtoday = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 23:59:59")); var nextday = today.AddDays(Convert.ToInt32(1 - Convert.ToInt32(today.DayOfWeek)) + 7); nextst = CommUtil.GetTimeStartByType("Week", nextday); var nextendday = endtoday.AddDays(Convert.ToInt32(1 - Convert.ToInt32(endtoday.DayOfWeek)) + 7); nextend = CommUtil.GetTimeEndByType("Week", nextendday); DataTable doct = bll.QueryDoctByDept(deptid, nextst, nextend); List <Oudayschedule> list = new List <Oudayschedule>(); if (doct == null || doct.Rows.Count == 0) { //提示无挂号医生 back.errcode = 0; back.errmsg = "暂无可挂号医生"; back.data = new List <Oudayschedule>(); } else { int mainNum = doct.Rows.Count; foreach (DataRow row in doct.Rows) { Oudayschedule days = new Oudayschedule(); BsUser user = new BsUser(); user.doctorid = Convert.ToInt32(row["id"]); user.name = row["docname"].ToString(); user.deptid = Convert.ToInt32(row["deptid"]); user.deptname = row["deptname"].ToString(); user.docgra = row["docgra"].ToString(); user.price = Convert.ToDouble(row["price"]); user.resume = row["resume"].ToString(); user.picture = row["picture"].ToString(); days.user = user; DataTable datalist = bll.QuerySchBydoct(user.doctorid, nextst, nextend); List <Schdatecs> dates = new List <Schdatecs>(); foreach (DataRow rw in datalist.Rows) { Schdatecs sch = new Schdatecs(); //sch.id = Convert.ToInt32(rw["id"]); sch.scheduledate = Convert.ToDateTime(rw["scheduledate"]).ToString("MM-dd"); sch.week = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(Convert.ToDateTime(rw["scheduledate"]).DayOfWeek); dates.Add(sch); } days.list = dates; list.Add(days); } back.errcode = 0; back.errmsg = ""; xml = JsonHelper.getJsonByObject((Object)list); back.data = list; } } catch (Exception ex) { back.errcode = -1; back.errmsg = ex.Message; back.data = new List <Oudayschedule>(); } msg = JsonHelper.getJsonByObject((Object)back); return(msg); }
public int AddBsUser(BsUser bsUser) { string sql = String.Format("insert into BsUser(username,password,realname,email,phone,address,zipcode) values('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}')", bsUser.Username, bsUser.Password, bsUser.Realname, bsUser.Email, bsUser.Phone, bsUser.Address, bsUser.Zipcode); return(SqlHelper.ExecuteNonQuery(sql)); }
public int EditBsUser(BsUser bsUser) { string sql = String.Format("update BsUser set username='******',password='******',realname='{2}',email='{3}',phone='{4}',address='{5}',ipcode='{6}',role={7} where id={8}", bsUser.Username, bsUser.Password, bsUser.Realname, bsUser.Email, bsUser.Phone, bsUser.Address, bsUser.Role, bsUser.Zipcode, bsUser.ID); return(SqlHelper.ExecuteNonQuery(sql)); }