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

            return(ret);
        }
Beispiel #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);
        }
Beispiel #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);
            }
        }
Beispiel #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);
        }
Beispiel #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);
        }