コード例 #1
0
        protected void Save_Click(object sender, EventArgs e)
        {
            string parameters = string.Empty;
            // Request Key 0-9 düzenli parametreler
            List<string> AllKeys = Request.Form.AllKeys.ToList();
            List<string> NewKeys = new List<string>();
            if (AllKeys.Count > 9)
            {
                for (int i = 10; i < AllKeys.Count; i++)
                {
                    NewKeys.Add(AllKeys[i]);
                }
            }

            if (NewKeys.Count > 0)
            {
                foreach (var item in NewKeys)
                {
                    parameters += Request.Form[item] + ",";    
                }
                parameters = parameters.Substring(0, parameters.Length - 1);     
            }

            DAI_VALIDATION_RULES validationRuleEnt = new DAI_VALIDATION_RULES();
            validationRuleEnt.ClassName = dominObjList.SelectedItem.Value;
            validationRuleEnt.FieldName = fieldList.SelectedItem.Value;
            validationRuleEnt.RuleName = validationRule.SelectedItem.Value;
            validationRuleEnt.OtherParams = parameters;
            validationRuleEnt.ErrorMessage = errTxt.Text;
            AutoContext db = new AutoContext();
            db.DAI_VALIDATION_RULES.AddItem(validationRuleEnt);
            db.SaveChanges();
        }
コード例 #2
0
        protected void Save_Click(object sender, EventArgs e)
        {
            string parameters = string.Empty;
            // Request Key 0-9 düzenli parametreler
            List <string> AllKeys = Request.Form.AllKeys.ToList();
            List <string> NewKeys = new List <string>();

            if (AllKeys.Count > 9)
            {
                for (int i = 10; i < AllKeys.Count; i++)
                {
                    NewKeys.Add(AllKeys[i]);
                }
            }

            if (NewKeys.Count > 0)
            {
                foreach (var item in NewKeys)
                {
                    parameters += Request.Form[item] + ",";
                }
                parameters = parameters.Substring(0, parameters.Length - 1);
            }

            DAI_VALIDATION_RULES validationRuleEnt = new DAI_VALIDATION_RULES();

            validationRuleEnt.ClassName    = dominObjList.SelectedItem.Value;
            validationRuleEnt.FieldName    = fieldList.SelectedItem.Value;
            validationRuleEnt.RuleName     = validationRule.SelectedItem.Value;
            validationRuleEnt.OtherParams  = parameters;
            validationRuleEnt.ErrorMessage = errTxt.Text;
            AutoContext db = new AutoContext();

            db.DAI_VALIDATION_RULES.AddItem(validationRuleEnt);
            db.SaveChanges();
        }