Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public BusinessFlow NewForm()
        {
            var pkeys = this.Component.PrimaryKeys.Split(',');

            if (this.Component.PrimaryKeys == "")
            {
                throw new Exception("Component must have atleast one key field.");
            }
            var k = new List <UIFormKey>();

            formBuilder = new FormBuilder(this.ClientID, this.Component.ComponentID, k, new FormFieldBuilder());
            Form        = formBuilder.UIForm;
            return(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fkey"></param>
        /// <returns></returns>
        public BusinessFlow NewForm(List <UIFormKey> fkey)
        {
            var pkeys = this.Component.PrimaryKeys.Split(',');

            foreach (UIFormKey fk in fkey)
            {
                if (fk.Key != "")
                {
                    var v = pkeys.Where(x => x == fk.Key).FirstOrDefault();
                    if (v == null)
                    {
                        throw new Exception("Key field dosn't Exist. Contact your system administrator");
                    }
                }
                else
                {
                    throw new Exception("Key field cannot be empty. Contact your system administrator");
                }
            }
            formBuilder = new FormBuilder(this.ClientID, this.Component.ComponentID, fkey, new FormFieldBuilder());
            Form        = formBuilder.UIForm;
            return(this);
        }