/// <summary> /// 登记一条排班模板 /// </summary> /// <param name="templet"></param> /// <returns></returns> public int Insert(Neusoft.HISFC.Models.Registration.SchemaTemplet templet) { string sql = ""; if (this.Sql.GetSql("Registration.Templet.Insert", ref sql) == -1) { return(-1); } try { sql = string.Format(sql, templet.ID, (int)templet.Week, (int)templet.EnumSchemaType, templet.Dept.ID, templet.Dept.Name, templet.Doct.ID, templet.Doct.Name, templet.Noon.ID, templet.RegQuota.ToString(), Neusoft.FrameWork.Function.NConvert.ToInt32(templet.IsValid), templet.Memo, templet.Oper.ID, templet.Oper.OperTime.ToString(), templet.DoctType.ID, templet.Begin.ToString(), templet.End.ToString(), templet.TelQuota, templet.SpeQuota, Neusoft.FrameWork.Function.NConvert.ToInt32(templet.IsAppend), templet.StopReason.ID, templet.StopReason.Name, templet.RegLevel.ID, templet.RegLevel.Name); } catch (Exception e) { this.Err = "[Registration.Templet.Insert]格式不匹配!" + e.Message; this.ErrCode = e.Message; return(-1); } return(this.ExecNoQuery(sql)); }
/// <summary> /// 根据排班模板ID更新排班信息(未使用的) /// </summary> /// <param name="schema"></param> /// <returns></returns> public int UpdateUnusedZZ(Neusoft.HISFC.Models.Registration.SchemaTemplet schemaTemplet) { string sql = ""; if (this.Sql.GetSql("ZZ.Registration.Schema.UpdateUnUse", ref sql) == -1) { return(-1); } try { sql = string.Format(sql, schemaTemplet.ID, schemaTemplet.Noon.ID, schemaTemplet.Begin.ToString(), schemaTemplet.End.ToString(), schemaTemplet.Dept.ID, schemaTemplet.Dept.Name, schemaTemplet.Doct.ID, schemaTemplet.Doct.Name, schemaTemplet.DoctType.ID, schemaTemplet.RegQuota, schemaTemplet.TelQuota, schemaTemplet.SpeQuota, Neusoft.FrameWork.Function.NConvert.ToInt32(schemaTemplet.IsValid), Neusoft.FrameWork.Function.NConvert.ToInt32(schemaTemplet.IsAppend), schemaTemplet.StopReason.ID, schemaTemplet.StopReason.Name, schemaTemplet.Stop.ID, schemaTemplet.Stop.OperTime.ToString(), schemaTemplet.Memo, schemaTemplet.Oper.ID, schemaTemplet.Oper.OperTime.ToString(), schemaTemplet.RegLevel.ID, schemaTemplet.RegLevel.Name); } catch (Exception e) { this.Err = "[Registration.Schema.Update.3]格式不匹配!" + e.Message; this.ErrCode = e.Message; return(-1); } return(this.ExecNoQuery(sql)); }
/// <summary> /// 查询 /// </summary> /// <param name="sql"></param> /// <returns></returns> private ArrayList QueryBase(string sql) { if (this.ExecQuery(sql) == -1) { return(null); } this.al = new ArrayList(); try { while (this.Reader.Read()) { this.schemaTemplet = new Neusoft.HISFC.Models.Registration.SchemaTemplet(); this.schemaTemplet.ID = this.Reader[2].ToString(); this.schemaTemplet.Week = (DayOfWeek)(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[3].ToString())); this.schemaTemplet.EnumSchemaType = (Neusoft.HISFC.Models.Base.EnumSchemaType)(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[4].ToString())); this.schemaTemplet.Dept.ID = this.Reader[5].ToString(); this.schemaTemplet.Dept.Name = this.Reader[6].ToString(); this.schemaTemplet.Doct.ID = this.Reader[7].ToString(); this.schemaTemplet.Doct.Name = this.Reader[8].ToString(); this.schemaTemplet.Noon.ID = this.Reader[9].ToString(); this.schemaTemplet.RegQuota = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[10].ToString()); this.schemaTemplet.IsValid = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[11].ToString()); this.schemaTemplet.Memo = this.Reader[12].ToString(); this.schemaTemplet.Oper.ID = this.Reader[13].ToString(); this.schemaTemplet.Oper.OperTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[14].ToString()); this.schemaTemplet.DoctType.ID = this.Reader[15].ToString(); this.schemaTemplet.Begin = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[16].ToString()); this.schemaTemplet.End = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[17].ToString()); this.schemaTemplet.TelQuota = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[18].ToString()); this.schemaTemplet.SpeQuota = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[19].ToString()); this.schemaTemplet.IsAppend = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[20].ToString()); this.schemaTemplet.StopReason.ID = this.Reader[21].ToString(); this.schemaTemplet.StopReason.Name = this.Reader[22].ToString(); this.schemaTemplet.RegLevel.ID = this.Reader[23].ToString(); this.schemaTemplet.RegLevel.Name = this.Reader[24].ToString(); this.al.Add(this.schemaTemplet); } this.Reader.Close(); } catch (Exception e) { this.Err = "查询排班模板信息出错!" + e.Message; this.ErrCode = e.Message; return(null); } return(al); }