Esempio n. 1
0
 public LabelVLBinder(DBManager db, Label c, string name, WFValueList vl, DBFilter filter)
 {
     this.c     = c;
     this.name  = name;
     this.field = db.getField(name);
     this.vl    = vl;
 }
Esempio n. 2
0
 public DropDownVLBinder(DBManager db, DropDownList c, WFValueList vl, DBFilter filter, string name)
 {
     this.filter = filter;
     this.c      = c;
     this.name   = name;
     this.field  = db.getField(name);
     this.vl     = vl;
 }
Esempio n. 3
0
        protected override void beforeUpdate(DatabaseConnection dbConn, DBManager db)
        {
            base.beforeUpdate(dbConn, db);
            DBField syncIDField = db.getField("SynID");

            if (syncIDField != null)
            {
                if (string.IsNullOrEmpty((string)syncIDField.getValue(this)))
                {
                    syncIDField.setValue(this, Guid.NewGuid().ToString().ToUpper());
                }
            }
        }
Esempio n. 4
0
 public TextBoxBinder(DBManager db, TextBox c, string name)
 {
     this.c     = c;
     this.name  = name;
     this.field = db.getField(name);
     if (this.field != null)
     {
         MaxLengthAttribute m = (MaxLengthAttribute)this.field.findAttribute(typeof(MaxLengthAttribute));
         if (m != null)
         {
             maxlength = m.getMaxLength();
             size      = m.getMaxTextBoxLength();
         }
     }
 }
Esempio n. 5
0
 public HiddenBinder(DBManager db, HtmlInputHidden c, string name)
 {
     this.c     = c;
     this.name  = name;
     this.field = db.getField(name);
 }
Esempio n. 6
0
 public HiddenBinder(DBManager db, HtmlInputHidden c)
 {
     this.c     = c;
     this.name  = c.ID;
     this.field = db.getField(name);
 }
Esempio n. 7
0
 public RadioButtonListBinder(DBManager db, RadioButtonList c, string name)
 {
     this.c     = c;
     this.name  = name;
     this.field = db.getField(name);
 }
Esempio n. 8
0
 public LabelBinder(DBManager db, Label c, string name)
 {
     this.c     = c;
     this.name  = name;
     this.field = db.getField(name);
 }
Esempio n. 9
0
 public CheckBoxBinder(DBManager db, CheckBox c)
 {
     this.c     = c;
     this.name  = c.ID;
     this.field = db.getField(name);
 }
Esempio n. 10
0
 public CheckBoxBinder(DBManager db, CheckBox c, string name)
 {
     this.c     = c;
     this.name  = name;
     this.field = db.getField(name);
 }
Esempio n. 11
0
        public string getValue(object v, string name)
        {
            object s = null;

            if (v is DataRowView)
            {
                DataRowView r = (DataRowView)v;
                s = r[name];
            }
            else if (v is DataRow)
            {
                DataRow r = (DataRow)v;
                s = r[name];
            }
            else if (v is DBObject)
            {
                System.Reflection.PropertyInfo propInfo = v.GetType().GetProperty(name);
                if (propInfo != null)
                {
                    s = propInfo.GetValue(v, null);
                }
            }

            if (s == null || Convert.IsDBNull(s))
            {
                return("");
            }

            if (db != null)
            {
                DBField f = db.getField(name);
                if (f != null && f.transcoder != null)
                {
                    s = f.transcoder.fromDB(s);
                }
            }

            Hashtable map = (Hashtable)values[name];

            if (map != null && s != null)
            {
                object s1 = map[s.ToString()];
                if (s1 == null)
                {
                    try
                    {
                        s1 = map[Convert.ToInt32(s)];
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Debug.WriteLine(ex.Message);
                    }
                }
                if (s1 != null)
                {
                    s = s1;
                }
            }


            s = s.ToString().Trim();
            return(HTMLUtils.toHTMLText(s.ToString()));
        }