예제 #1
0
        /// <summary>
        /// ����ϵͳ���롣
        /// </summary>
        /// <param name="dto">������ϵͳ�������Ϣ��</param>
        /// <returns>��ϵͳ�����Id����-2��Tag�ظ�����</returns>
        public static string InsertSysCode(SysCodeDTO dto)
        {
            SysCode existingSc = GetSysCodeByTag(dto.Tag);
            if (existingSc != null) { return "-2"; }

            Db.SessionFactory.EvictQueries("SysCode");

            SysCode sc = new SysCode();
            sc.Id = IdGen.GetNextId(typeof(SysCode));
            sc.Tag = dto.Tag;
            sc.Name = dto.Name;
            sc.Remark = dto.Remark;
            sc.OrderId = dto.OrderId;

            SysCodeType sct = Db.Session.Load(typeof(SysCodeType), dto.SysCodeTypeId) as SysCodeType;
            sct.AddSysCode(sc);

            Db.TransInsert(sc);
            return sc.Id;
        }
예제 #2
0
 /// <summary>
 /// ����һ�����롣
 /// </summary>
 /// <param name="staff">���롣</param>
 public void AddSysCode(SysCode s)
 {
     this.SysCodes.Add(s);
     s.SysCodeType = this;
 }
예제 #3
0
 /// <summary>
 /// 增加一个代码。
 /// </summary>
 /// <param name="staff">代码。</param>
 public void AddSysCode(SysCode s)
 {
     this.SysCodes.Add(s);
     s.SysCodeType = this;
 }