Example #1
0
        public virtual FormViewMode DetermineMode(string EntityID, ScreenInputType EntityInputType)
        {
            FormViewMode retVal = FormViewMode.ReadOnly;


            string EntityIDValue = this.GetEntityIDValue(this.Screen, EntityID, EntityInputType);

            if (String.IsNullOrEmpty(EntityIDValue))
            {
                retVal = FormViewMode.Insert;
            }
            else
            {
                retVal = FormViewMode.Edit;
            }

            return(retVal);
        }
Example #2
0
        public string GetEntityIDValue(Screen screen, string EntityID, ScreenInputType EntityInputType, Control container)
        {
            string retVal = null;
            ScreenDataCommandParameter p = new ScreenDataCommandParameter(EntityID, EntityInputType);
            object EntityIDValue         = Common.GetParameterInputValue(this, p, container);

            if (EntityIDValue != null)
            {
                retVal = EntityIDValue.ToString();
            }


            //switch (EntityInputType)
            //{
            //    case ScreenInputType.QueryString:
            //        EntityIDValue = Request.QueryString[EntityID];
            //        break;
            //    case ScreenInputType.User:
            //        try
            //        {
            //            List<string> profileProperties = CodeTorch.Core.Configuration.GetInstance().App.ProfileProperties;
            //            int propertyIndex = Enumerable.Range(0, profileProperties.Count).First(i => profileProperties[i].ToLower() == EntityID.ToLower());

            //            FormsIdentity identity = (FormsIdentity)HttpContext.Current.User.Identity;
            //            FormsAuthenticationTicket ticket = identity.Ticket;

            //            EntityIDValue = ticket.UserData.Split('|')[propertyIndex];

            //        }
            //        catch { }
            //        break;
            //}


            return(retVal);
        }
Example #3
0
 public string GetEntityIDValue(Screen screen, string EntityID, ScreenInputType EntityInputType)
 {
     return(GetEntityIDValue(screen, EntityID, EntityInputType, this));
 }
Example #4
0
 public ScreenDataCommandParameter(string Key, object Value, ScreenInputType Type)
 {
     InputKey   = Key;
     InputType  = Type;
     this.Value = Value;
 }
Example #5
0
 public ScreenDataCommandParameter(string Key, ScreenInputType Type)
 {
     InputKey  = Key;
     InputType = Type;
 }
Example #6
0
 public ReportParameter(string Key, object Value, ScreenInputType Type)
 {
     InputKey   = Key;
     InputType  = Type;
     this.Value = Value;
 }
Example #7
0
 public ReportParameter(string Key, ScreenInputType Type)
 {
     InputKey  = Key;
     InputType = Type;
 }