Example #1
0
    private void Fill_GridRuleDateRanges_MasterRulesView(decimal RuleGroupID, decimal RuleID)
    {
        string[] retMessage = new string[4];
        IList <AssignRuleParameter> RuleDateRangesList = null;

        try
        {
            BRuleViewer RulesViewerBusiness = new BRuleViewer(RuleGroupID);
            RuleDateRangesList = RulesViewerBusiness.GetAllRuleParametersRange(RuleID);
            this.GridRuleDateRanges_MasterRulesView.DataSource = RuleDateRangesList;
            this.GridRuleDateRanges_MasterRulesView.DataBind();
        }
        catch (UIValidationExceptions ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
            this.ErrorHiddenField_RuleDateRanges.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
        }
        catch (UIBaseException ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
            this.ErrorHiddenField_RuleDateRanges.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
        }
        catch (Exception ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
            this.ErrorHiddenField_RuleDateRanges.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
        }
    }
Example #2
0
        public void TestSetup()
        {
            assignRuleParameter_testObject = new AssignRuleParameter();
            int ruleTypeID = Convert.ToInt32(new TA_RuleTypeTableAdapter().GetData().Rows[0]["RuleType_ID"]);

            catTA.Insert("TestCategory", "", false, "00-00test1");
            DatabaseGateway.TA_RuleCategoryDataTable cat = new DatabaseGateway.TA_RuleCategoryDataTable();
            cat             = catTA.GetDataByName("TestCategory");
            ADORuleCat.ID   = Convert.ToInt32(cat.Rows[0]["ruleCat_ID"]);
            ADORuleCat.Name = Convert.ToString(cat.Rows[0]["ruleCat_Name"]);

            ruleTA.Insert(1033, "a", "a", "a", 67, false, ADORuleCat.ID, ruleTypeID, 0);
            DatabaseGateway.TA_RuleDataTable ruleTable = new DatabaseGateway.TA_RuleDataTable();
            ruleTable              = ruleTA.GetByIdentifierCode(1033);
            ADORule.ID             = Convert.ToInt32(ruleTable.Rows[0]["rule_ID"]);
            ADORule.IdentifierCode = Convert.ToInt32(ruleTable.Rows[0]["rule_IdentifierCode"]);
            ADORule.TemplateId     = Convert.ToInt32(ruleTable.Rows[0]["rule_RuleTmpId"]);
            ADORule.CategoryId     = Convert.ToInt32(ruleTable.Rows[0]["rule_RuleCategoryId"]);

            assignRuleTA.Insert(new DateTime(2000, 1, 1), new DateTime(2001, 1, 1), ADORule.ID);
            assignRuleTA.Insert(new DateTime(2002, 1, 1), new DateTime(2003, 1, 1), ADORule.ID);
            DatabaseGateway.TA_AssignRuleParameterDataTable assignTable = new DatabaseGateway.TA_AssignRuleParameterDataTable();
            assignTable = assignRuleTA.GetDataByRuleID(ADORule.ID);

            ADOAssignRuleParam1.ID       = Convert.ToInt32(assignTable.Rows[0]["AsgRuleParam_ID"]);
            ADOAssignRuleParam1.FromDate = Convert.ToDateTime(assignTable.Rows[0]["AsgRuleParam_FromDate"]);
            ADOAssignRuleParam1.ToDate   = Convert.ToDateTime(assignTable.Rows[0]["AsgRuleParam_ToDate"]);

            ADOAssignRuleParam2.ID       = Convert.ToInt32(assignTable.Rows[1]["AsgRuleParam_ID"]);
            ADOAssignRuleParam2.FromDate = Convert.ToDateTime(assignTable.Rows[1]["AsgRuleParam_FromDate"]);
            ADOAssignRuleParam2.ToDate   = Convert.ToDateTime(assignTable.Rows[1]["AsgRuleParam_ToDate"]);

            parameterTA.Insert(ADOAssignRuleParam1.ID, "Param1", "0", 0, "");
            parameterTA.Insert(ADOAssignRuleParam1.ID, "Param2", "0", 0, "");

            DatabaseGateway.TA_RuleParameterDataTable paramTable = new DatabaseGateway.TA_RuleParameterDataTable();
            parameterTA.FillByAssignID(paramTable, ADOAssignRuleParam1.ID);

            ADOParameter1.ID    = Convert.ToInt32(paramTable.Rows[0]["RuleParam_ID"]);
            ADOParameter1.Value = Convert.ToString(paramTable.Rows[0]["RuleParam_Value"]);
            ADOParameter1.Name  = Convert.ToString(paramTable.Rows[0]["RuleParam_Name"]);
            ADOParameter1.Title = Convert.ToString(paramTable.Rows[0]["RuleParam_Title"]);
            ADOParameter1.Type  = (RuleParamType)Convert.ToInt32(paramTable.Rows[0]["RuleParam_Type"]);

            ADOParameter2.ID    = Convert.ToInt32(paramTable.Rows[1]["RuleParam_ID"]);
            ADOParameter2.Value = Convert.ToString(paramTable.Rows[1]["RuleParam_Value"]);
            ADOParameter2.Name  = Convert.ToString(paramTable.Rows[1]["RuleParam_Name"]);
            ADOParameter2.Title = Convert.ToString(paramTable.Rows[1]["RuleParam_Title"]);
            ADOParameter2.Type  = (RuleParamType)Convert.ToInt32(paramTable.Rows[1]["RuleParam_Type"]);

            businessRuleViwer = new BRuleViewer(ADORuleCat.ID);
        }
Example #3
0
    private void FillChilds_GridRules_RulesView(GridNeedChildDataSourceEventArgs e)
    {
        if (e.Item.Level == 0)
        {
            decimal RuleGroupID = 0;
            if (HttpContext.Current.Request.QueryString.AllKeys.Contains("RuleGroupID"))
            {
                RuleGroupID = decimal.Parse(this.StringBuilder.CreateString(HttpContext.Current.Request.QueryString["RuleGroupID"]));
            }

            BRuleViewer RulesViewerBusiness        = this.GetRuleViewerBusiness(RuleGroupID);
            IList <GTS.Clock.Model.Rule> RulesList = RulesViewerBusiness.GetAllRules((decimal)e.Item["ID"]);
            e.DataSource = RulesList;
        }
    }
Example #4
0
    private void Fill_GridRules_RulesView(decimal RuleGroupID)
    {
        string[]         retMessage      = new string[4];
        IList <RuleType> RulesGroupsList = null;

        try
        {
            if (Session["RulesSource_RulesView"] == null)
            {
                BRuleViewer RulesViewerBusiness = this.GetRuleViewerBusiness(RuleGroupID);
                RulesGroupsList = RulesViewerBusiness.GetAllRuleTypes();
                foreach (RuleType ruleGroupItem in RulesGroupsList)
                {
                    ruleGroupItem.Name = GetLocalResourceObject(ruleGroupItem.Name).ToString();
                }
                Session.Add("RulesSource_RulesView", RulesGroupsList);
            }
            this.GridRules_RulesView.DataSource = (IList <RuleType>)Session["RulesSource_RulesView"];
            this.GridRules_RulesView.DataBind();
        }
        catch (UIValidationExceptions ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
            this.ErrorHiddenField_RulesView.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
        }
        catch (UIBaseException ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
            this.ErrorHiddenField_RulesView.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
        }
        catch (Exception ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
            this.ErrorHiddenField_RulesView.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
        }
    }