Ejemplo n.º 1
0
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            //return base.ConvertFrom(context, culture, value);
            QcProTaskJobDescriptor ds = context.Instance as QcProTaskJobDescriptor;
            QcJob  job = ds.RowObject as QcJob;
            string v   = value.ToString();

            if (job != null)
            {
                var s = 类别s.Where(t => t.Name == v).FirstOrDefault();
                select = s;
                if (s != null)
                {
                    if (job["方案ID"].Length > s.Code.Length)
                    {
                        if (job["方案ID"].Substring(0, s.Code.Length) != s.Code)
                        {
                            job["方案ID"] = "";
                        }
                    }
                    return(s.Code);
                }
            }
            return("");
        }
Ejemplo n.º 2
0
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            //return base.ConvertFrom(context, culture, value);
            QcProTaskJobDescriptor ds = context.Instance as QcProTaskJobDescriptor;
            QcJob job = ds.RowObject as QcJob;

            string v = value.ToString();

            if (v.IndexOf('|') > 0)
            {
                v = v.Split('|')[1];
            }
            if (job != null)
            {
                var s = 方案s.Where(t => t["方案ID"] == v).FirstOrDefault();
                if (s != null)
                {
                    job["产品级别编码"]   = s["产品级别编码"];
                    job["产品类别编码"]   = s["产品类别编码"];
                    job["质量评价模型类型"] = s["产品类别名称"];
                }
            }
            QcCheckProject cp = 方案s.First(t => t.Name == value.ToString());

            return(cp.Code);
        }