コード例 #1
0
        public static bool  AddNewDepartment(string name, string content = "")
        {
            QcDepartment d   = new QcDepartment(name, content);
            bool         ret = d.Update();

            return(ret);
        }
コード例 #2
0
        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            //return base.ConvertTo(context, culture, value, destinationType);
            QcDepartment d = QcDepartment.GetDepartmentFromCode(value.ToString());

            return((d == null) ? "" : d.Name);
        }
コード例 #3
0
        static private void InitDepartment()
        {
            lstDepartment = new List <QcDepartment>();
            var Departments = DbHelper.Query("select * from QC_USE_Department");

            foreach (var v in Departments)
            {
                var qp = new QcDepartment(v);
                lstDepartment.Add(qp);
            }
        }
コード例 #4
0
        public override bool Update(QcDbTransaction trans = null)
        {
            if (IsNew())
            {
                this.Code = QcDepartment.GetNextCode();
            }
            bool ret = base.Update(trans);

            if (ret == false && IsNew())
            {
                this.Code = "";
            }
            if (!Departments.Contains(this))
            {
                Departments.Add(this);
            }
            return(ret);
        }
コード例 #5
0
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            QcDepartment d = QcDepartment.GetDepartmentFromName(value.ToString());

            return((d == null) ? "" : d.Code);
        }