예제 #1
0
        private static void ManageValues(ControlCollection cc, dynamic[] instances, bool isgetctl)
        {
            string spropname = string.Empty, stype = string.Empty;
            bool   isbaseuc = false;

            foreach (Control c in cc)
            {
                if (c.ID != null)
                {
                    spropname = c.ID.Substring(3);
                    isbaseuc  = (c is BaseGMUC);
                    foreach (dynamic ob in instances)
                    {
                        try
                        {
                            if (!isgetctl)
                            {
                                stype = c.GetType().BaseType.Name;
                                if (stype.Equals(ControlTypeConstants.ListboxType) || stype.Equals(ControlTypeConstants.DropdownListType))
                                {
                                    UIUtilities.BindList(c, GMReflectionUtils.InvokeMember(ob, string.Format("{0}{1}", ReflectionConstants.DataSource, spropname), null, EnumConstants.GetProperty));
                                }
                                else if (stype.Equals(ControlTypeConstants.GridViewType))
                                {
                                    UIUtilities.BindGridView(c, GMReflectionUtils.InvokeMember(ob, spropname, null, EnumConstants.GetProperty));
                                }
                                else if (stype.Equals(ControlTypeConstants.TwolistType))
                                {
                                    UIUtilities.BindTwolist(c, GMReflectionUtils.InvokeMember(ob, string.Format("{0}{1}", ReflectionConstants.DataSource, ReflectionConstants.Selected), null, EnumConstants.GetProperty),
                                                            GMReflectionUtils.InvokeMember(ob, string.Format("{0}{1}", ReflectionConstants.DataSource, ReflectionConstants.UNSelected), null, EnumConstants.GetProperty));
                                }
                                GMReflectionUtils.InvokeProperty(c, ReflectionConstants.Value, new object[] { GMReflectionUtils.InvokeMember(ob, spropname, null, EnumConstants.GetProperty) });
                            }
                            else if (isgetctl && isbaseuc)
                            {
                                GMReflectionUtils.InvokeProperty(ob, spropname, new object[] { GMReflectionUtils.InvokeMember(c, ReflectionConstants.Value, null, EnumConstants.GetProperty) });
                            }
                        }
                        catch (EndUserException ex) { Logger.LogMessage(ex.Message); throw ex; }
                        catch (Exception ex) { Logger.LogMessage(ex.Message); }
                    }
                }
                if (!isbaseuc && c.Controls.Count > 0)
                {
                    ManageValues(c.Controls, instances, isgetctl);
                }
            }
        }
예제 #2
0
        BaseDC ExecuteAction(string actionname, bool isgetfromctl)
        {
            BaseDC bdc = GetDCInstance();

            if (PageID > 0)
            {
                bdc.ID = PageID;
            }
            bdc.SessionID = CryptoUtils.EncryptTripleDES(SessionID);
            if (isgetfromctl)
            {
                FillUIValues(bdc);              //To save information get the values from the control
            }
            bdc = (BaseDC)ExecuteAction(actionname, bdc, bdc);
            ValidateToken(bdc);
            if (!isgetfromctl)
            {
                UIUtilities.SetlValues(this.ControlsCollection, new object[] { bdc });                //To set value back to the control from Datacontract.
            }
            return(bdc);
        }
예제 #3
0
 public T GetQueryValue <T>(string qsname)
 {
     return(UIUtilities.GetQueryValue <T>(m_query, qsname));
 }
예제 #4
0
 protected void FillUIValues(BaseDC[] instances)
 {
     UIUtilities.FillValues(this.ControlsCollection, instances);
 }