/// <summary>
        /// 获取所有可显示属性标签
        /// </summary>
        /// <param name="widthLabel">是否显示Label</param>
        /// <returns></returns>
        public List <string> GetViewModelPropertyHtmlTag(bool widthLabel)
        {
            List <string> lists = new List <string>();

            foreach (var item in _attribute.GetHtmlTags(false))
            {
                if (_withValue)
                {
                    if (item is DropDownListHtmlTag)
                    {
                        DropDownListHtmlTag tag = item as DropDownListHtmlTag;
                        if (tag.SourceType == Constant.SourceType.ViewData &&
                            ExtendPropertyValue.ContainsKey(tag.SourceKey))
                        {
                            if (ExtendPropertyValue[tag.SourceKey] is Dictionary <string, string> )
                            {
                                tag.DataSource(ExtendPropertyValue[tag.SourceKey] as Dictionary <string, string>);
                            }
                        }
                    }
                    object val = ClassAction.GetObjPropertyValue(_entity, item.Name);
                    item.SetValue(val);
                }
                lists.Add(item.ToString(widthLabel));
            }
            return(lists);
        }
Exemple #2
0
 public ActionResult CreateStudent()
 {
     if ((string)Session["role"] == "Admin")
     {
         var         student     = UserAction.GetAll();
         List <User> lst_student = new List <User>();
         for (int i = 0; i < student.Count; i++)
         {
             if (student[i].role == "Student" && StudentAction.Find(student[i].id_number) == null)
             {
                 lst_student.Add(student[i]);
             }
         }
         ViewBag.Account     = lst_student;
         ViewBag.Nganh       = MajorAction.GetAll();
         ViewBag.ChuyenNganh = SpecializedAction.GetAll();
         ViewBag.Lop         = ClassAction.GetAll();
         ViewBag.SV          = StudentAction.ShowAll();
         return(View());
     }
     else
     {
         return(Redirect("~/Home/Index"));
     }
 }
Exemple #3
0
 public Transaction(ClassAction action, ClassesEnum classes, string loggedAction)
 {
     TransactionClass         = classes;
     TransactionClassAction   = action;
     TransactionAction        = loggedAction;
     TransactionEntryDateTime = DateTime.Now;
 }
Exemple #4
0
        public ActionResult RegisterSubject(string Id_Class, string Id_Subject, string Id_Teacher, int Year_Term)
        {
            if (Session["student_subject"] == null)
            {
                var gv            = TeacherAction.GetAll();
                var mh            = SubjectAction.GetAll();
                var lop           = ClassAction.GetAll();
                var nam           = YearTermAction.GetAll();
                var teacher_info  = gv.Find(a => a.id == Id_Teacher);
                var subject_infor = mh.Find(a => a.id == Id_Subject);
                var class_info    = lop.Find(a => a.id == Id_Class);
                var year_info     = nam.Find(a => a.year_term == Year_Term);
                List <Tuple <Subject, YearTerm, Class, Teacher> > lst = new List <Tuple <Subject, YearTerm, Class, Teacher> >();
                Tuple <Subject, YearTerm, Class, Teacher>         tup = new Tuple <Subject, YearTerm, Class, Teacher>(subject_infor, year_info, class_info, teacher_info);
                lst.Add(tup);
                Session["student_subject"] = lst;
            }
            else
            {
                List <Tuple <Subject, YearTerm, Class, Teacher> > lst = (List <Tuple <Subject, YearTerm, Class, Teacher> >)Session["student_subject"];
                var gv            = TeacherAction.GetAll();
                var mh            = SubjectAction.GetAll();
                var lop           = ClassAction.GetAll();
                var nam           = YearTermAction.GetAll();
                var teacher_info  = gv.Find(a => a.id == Id_Teacher);
                var subject_infor = mh.Find(a => a.id == Id_Subject);
                var class_info    = lop.Find(a => a.id == Id_Class);
                var year_info     = nam.Find(a => a.year_term == Year_Term);
                Tuple <Subject, YearTerm, Class, Teacher> tup = new Tuple <Subject, YearTerm, Class, Teacher>(subject_infor, year_info, class_info, teacher_info);
                lst.Add(tup);
                Session["student_subject"] = lst;
            }

            return(Redirect("~/Student/RegisterSubject"));
        }
Exemple #5
0
        /// <summary>
        /// Transaction Logging - Patient Transaction Logging
        /// </summary>
        /// <param name="classAction">Action Taken (Activate, Add, Modify, Disable, Delete)</param>
        /// <param name="classes">Action Class (Patient, Prescription, Refill)</param>
        /// <param name="idType">Type of ID that is being tracked</param>
        /// <param name="idNumber">ID Number of ID Type</param>
        /// <param name="loggedAction">String action for what was done</param>
        public Transaction(ClassAction action, ClassesEnum classes, ID_Type idType, int idNumber, string loggedAction)
        {
            TransactionClass       = classes;
            TransactionClassAction = action;
            TransactionAction      = loggedAction;

            TransactionPatientID     = idNumber;
            TransactionEntryDateTime = DateTime.Now;
        }
        public List <HtmlTagBase> GetViewModelPropertyHtmlTag()
        {
            List <HtmlTagBase> results = new List <HtmlTagBase>();

            foreach (var item in _attribute.GetHtmlTags(false))
            {
                object val = ClassAction.GetObjPropertyValue(_entity, item.Name);
                item.SetValue(val);
                results.Add(item);
            }
            return(results);
        }
Exemple #7
0
 public ActionResult CreateClass()
 {
     if ((string)Session["role"] == "Admin")
     {
         ViewBag.nganh = SpecializedAction.GetAll();
         ViewBag.Lop   = ClassAction.ShowAll();
         return(View());
     }
     else
     {
         return(Redirect("~/Home/Index"));
     }
 }
        public Expression <Func <T, bool> > AsExpression <T>() where T : class
        {
            Extension.QueryCollection queryCollection = new Extension.QueryCollection();
            var properties = typeof(T).GetTypeInfo().GetProperties();

            foreach (var item in Columns)
            {
                var p = properties.FirstOrDefault(m => m.Name.Equals(item.Data, StringComparison.OrdinalIgnoreCase));
                if (p == null)
                {
                    continue;
                }
                var    realType = Nullable.GetUnderlyingType(p.PropertyType) ?? p.PropertyType;
                string value    = null;
                if (item.Search != null && item.Search.Value.IsNotNullAndWhiteSpace())
                {
                    value = item.Search.Value;
                }
                else if (Search != null && Search.Value.IsNotNullAndWhiteSpace() && realType == typeof(string))
                {
                    value = Search.Value;
                }
                if ((item.Search.Opeartor == Query.Operators.Range && item.Search.ValueMin.IsNullOrWhiteSpace() && item.Search.ValueMax.IsNullOrWhiteSpace()) ||
                    (item.Search.Opeartor != Query.Operators.Range && value.IsNullOrWhiteSpace()))
                {
                    continue;
                }

                Query query = new Query();
                query.Name = p.Name;
                try
                {
                    query.Value    = ClassAction.ValueConvert(p, value);
                    query.ValueMin = ClassAction.ValueConvert(p, item.Search.ValueMin);
                    query.ValueMax = ClassAction.ValueConvert(p, item.Search.ValueMax);

                    if (query.ValueMax != null && query.ValueMax is DateTime)
                    {
                        query.ValueMax = ((DateTime)query.ValueMax).AddDays(1).AddMilliseconds(-1);
                    }
                }
                catch
                {
                    continue;
                }

                query.Operator = item.Search.Opeartor;
                queryCollection.Add(query);
            }
            return(queryCollection.AsExpression <T>(Query.Condition.AndAlso));
        }
        /// <summary>
        /// 获取对应属性的标签
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        public string GetViewModelPropertyHtmlTag(string property)
        {
            var tag = _attribute.GetHtmlTag(property);

            if (_withValue)
            {
                object val = ClassAction.GetObjPropertyValue(_entity, property);
                tag.SetValue(val);
            }
            else
            {
                tag.SetValue(null);
            }
            return(tag.ToString());
        }
        /// <summary>
        /// 获取所有隐藏控件
        /// </summary>
        /// <returns></returns>
        public List <string> GetViewModelHiddenTargets()
        {
            List <string> lists = new List <string>();

            foreach (var item in _attribute.GetHtmlHiddenTags())
            {
                if (_withValue)
                {
                    object val = ClassAction.GetObjPropertyValue(_entity, item.Name);
                    item.SetValue(val);
                }
                lists.Add(item.ToString(false));
            }
            return(lists);
        }
Exemple #11
0
 public ActionResult CreateSubject()
 {
     if ((string)Session["role"] == "Admin")
     {
         ViewBag.ChuyenNganh = SpecializedAction.GetAll();
         ViewBag.Nganh       = MajorAction.GetAll();
         ViewBag.Lop         = ClassAction.GetAll();
         ViewBag.MH          = SubjectAction.ShowAll();
         ViewBag.GV          = TeacherAction.GetAll();
         ViewBag.YearTerm    = YearTermAction.GetAll();
         return(View());
     }
     else
     {
         return(Redirect("~/Home/Index"));
     }
 }
        public virtual T CellConvert(T item, string header, Cell cell)
        {
            Type type = typeof(T);

            string propertyName = header;
            string value        = ReadCellValue(cell);

            if (_viewConfigure != null)
            {
                var descriptor = _viewConfigure.GetViewPortDescriptors(true).FirstOrDefault(m => m.DisplayName == header);
                if (descriptor != null)
                {
                    propertyName = descriptor.Name;
                    var dropdown = descriptor as DropDownListDescriptor;
                    if (dropdown != null)
                    {
                        foreach (var op in dropdown.OptionItems)
                        {
                            if (op.Value == value)
                            {
                                value = op.Key;
                            }
                        }
                    }
                }
            }
            var property = _entryProperites.FirstOrDefault(m => m.Name == propertyName);

            if (property != null && value != null)
            {
                var    convert        = Converts.FirstOrDefault(m => m.SupportType == property.PropertyType);
                object convertedValue = null;
                if (convert != null)
                {
                    convertedValue = convert.Convert(value);
                }
                else
                {
                    convertedValue = ClassAction.ValueConvert(property, value);
                }
                property.SetValue(item, convertedValue);
            }

            return(item);
        }
        public SectionGroup GenerateContentFromConfig(SectionGroup group)
        {
            string configFile = _pluginLoader.GetPlugins().First(m => m.ID == SectionPlug.PluginID).RelativePath + @"\Thumbnail\{0}.xml".FormatWith(group.PartialView);
            List <SectionContent> contents = new List <SectionContent>();

            if (File.Exists(configFile))
            {
                XmlDocument doc        = new XmlDocument();
                FileStream  fileStream = new FileStream(configFile, FileMode.Open);
                doc.Load(fileStream);
                var nodes = doc.SelectNodes("/required/item");
                foreach (XmlNode item in nodes)
                {
                    var attr = item.Attributes["type"];
                    if (attr != null && attr.Value.IsNotNullAndWhiteSpace())
                    {
                        try
                        {
                            if (SectionPlug.ContentTypes.ContainsKey(attr.Value))
                            {
                                var content    = Activator.CreateInstance(SectionPlug.ContentTypes[attr.Value]) as SectionContent;
                                var properties = item.SelectNodes("property");
                                foreach (XmlNode property in properties)
                                {
                                    var name = property.Attributes["name"];
                                    if (name != null && name.Value.IsNotNullAndWhiteSpace() && property.InnerText.IsNotNullAndWhiteSpace())
                                    {
                                        ClassAction.SetObjPropertyValue(content, name.Value, property.InnerText);
                                    }
                                }
                                content.SectionGroupId  = group.ID;
                                content.SectionWidgetId = group.SectionWidgetId;
                                contents.Add(content);
                            }
                        }
                        catch (Exception ex)
                        {
                            Logger.Error(ex);
                        }
                    }
                }
            }
            group.SectionContents = contents;
            return(group);
        }
Exemple #14
0
        public SectionGroup GenerateContentFromConfig(SectionGroup group)
        {
            string configFile = PluginBase.GetPath <SectionPlug>().CombinePath("Thumbnail/{0}.xml".FormatWith(group.PartialView).ToFilePath());
            List <SectionContent> contents = new List <SectionContent>();

            if (File.Exists(configFile))
            {
                using (FileStream fileStream = new FileStream(configFile, FileMode.Open))
                {
                    XmlDocument doc = new XmlDocument();
                    doc.Load(fileStream);
                    var          nodes         = doc.SelectNodes("/required/item");
                    const string fullNameSpace = "ZKEACMS.SectionWidget.Models.{0}";
                    foreach (XmlNode item in nodes)
                    {
                        var attr = item.Attributes["type"];

                        if (attr != null && attr.Value.IsNotNullAndWhiteSpace())
                        {
                            var    typeInfoArray = attr.Value.Split('.');
                            string fullTypeInfo  = fullNameSpace.FormatWith(typeInfoArray[typeInfoArray.Length - 1]);
                            if (SectionPlug.ContentTypes.ContainsKey(fullTypeInfo))
                            {
                                var content    = Activator.CreateInstance(SectionPlug.ContentTypes[fullTypeInfo]) as SectionContent;
                                var properties = item.SelectNodes("property");
                                foreach (XmlNode property in properties)
                                {
                                    var name = property.Attributes["name"];
                                    if (name != null && name.Value.IsNotNullAndWhiteSpace() && property.InnerText.IsNotNullAndWhiteSpace())
                                    {
                                        ClassAction.SetObjPropertyValue(content, name.Value, property.InnerText);
                                    }
                                }
                                content.SectionGroupId  = group.ID;
                                content.SectionWidgetId = group.SectionWidgetId;
                                contents.Add(content);
                            }
                        }
                    }
                }
            }
            group.SectionContents = contents;
            return(group);
        }
Exemple #15
0
        public SectionGroup GenerateContentFromConfig(SectionGroup group)
        {
            string configFile = AppDomain.CurrentDomain.BaseDirectory + @"Modules\Section\Views\Thumbnail\{0}.xml".FormatWith(group.PartialView);
            List <SectionContent> contents = new List <SectionContent>();

            if (File.Exists(configFile))
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(configFile);
                var nodes = doc.SelectNodes("/required/item");
                foreach (XmlNode item in nodes)
                {
                    var attr = item.Attributes["type"];
                    if (attr != null && attr.Value.IsNotNullAndWhiteSpace())
                    {
                        try
                        {
                            var content    = Activator.CreateInstance("Easy.CMS.Section", "Easy.CMS.Section.Models." + attr.Value).Unwrap() as SectionContent;
                            var properties = item.SelectNodes("property");
                            foreach (XmlNode property in properties)
                            {
                                var name = property.Attributes["name"];
                                if (name != null && name.Value.IsNotNullAndWhiteSpace() && property.InnerText.IsNotNullAndWhiteSpace())
                                {
                                    ClassAction.SetObjPropertyValue(content, name.Value, property.InnerText);
                                }
                            }
                            content.SectionGroupId  = group.ID;
                            content.SectionWidgetId = group.SectionWidgetId;
                            contents.Add(content);
                        }
                        catch (Exception ex)
                        {
                            Logger.Error(ex);
                        }
                    }
                }
            }
            group.SectionContents = contents;
            return(group);
        }
Exemple #16
0
 public ActionResult CreateTeacher()
 {
     if ((string)Session["role"] == "Admin")
     {
         var         teacher  = UserAction.GetAll();
         List <User> lst_user = new List <User>();
         for (int i = 0; i < teacher.Count; i++)
         {
             if (teacher[i].role == "Teacher" && TeacherAction.Find(teacher[i].id_number) == null)
             {
                 lst_user.Add(teacher[i]);
             }
         }
         ViewBag.Account = lst_user;
         ViewBag.Nganh   = MajorAction.GetAll();
         ViewBag.Lop     = ClassAction.GetAll();
         ViewBag.GV      = TeacherAction.ShowAll();
         return(View());
     }
     else
     {
         return(Redirect("~/Home/Index"));
     }
 }
Exemple #17
0
        public override async Task <bool> InvokeAsync(string paramList)
        {
            var DawnQuestMember = _Realm.GameData.GetSheet("DawnQuestMember");
            var DawnContent     = _Realm.GameData.GetSheet("DawnContent");
            var DawnGrowMember  = _Realm.GameData.GetSheet("DawnGrowMember");

            var recipes        = _Realm.GameData.GetSheet <Recipe>();
            var craftaction    = _Realm.GameData.GetSheet <CraftAction>();
            var generalActions = _Realm.GameData.GetSheet <Action>();
            var classes        = _Realm.GameData.GetSheet <ClassJobCategory>();

            var actions = craftaction.Where(row => row.ClassJobCategory.Key != 0 && row.ClassJob != null);
            List <ClassAction> actionList = new List <ClassAction>();

            foreach (var craft in actions)
            {
                //OutputInformation($"{craft.Name} {craft.Key} {craft.ClassJob.Name.ToString()}");
                var temp = new ClassAction(craft.Key, craft.Name.ToString(), craft.ClassJob.Name.ToString().FirstCharToUpper());
                //OutputInformation($"craft: {temp}");
                actionList.Add(temp);
            }

            var genActions = generalActions.Where(row => row.ActionCategory.Key == 7 && row.ClassJob != null && row.ClassJob.Key > 0 && row.ClassJob != null && row.Name != null);

            //OutputInformation($"{genActions.Count()}");
            foreach (var craft in genActions)
            {
                //OutputInformation($"{craft.Key}");
                // OutputInformation($"{craft.Name}"); //{craft.ClassJob.Name.ToString()}");

                var temp = new ClassAction(craft.Key, craft.Name.ToString(), craft.ClassJob.Name.ToString().FirstCharToUpper());
                //OutputInformation($"gen: {temp}");
                actionList.Add(temp);
            }

/*
 *          var tmp = classes[33];
 *
 *          foreach(var cl in tmp.ClassJobs)
 *              OutputInformation($@"""{cl.Name.ToString().FirstCharToUpper()}"",");
 *
 *
 *          using (StreamWriter outputFile = new StreamWriter("CraftingActions.json", false))
 *          {
 *              outputFile.Write(JsonConvert.SerializeObject(actionList, Formatting.Indented));
 *          }*/

            foreach (var rec in recipes.Where(row => row.ResultItem.Name.ToString().Contains("Skybuilders") && row.RecipeLevel.RecipeLevelTable.Key == 430))
            {
                OutputInformation($"\t\t<!-- {rec.ResultItem.Name} -->");
                OutputInformation($"\t\t<If Condition=\"Core.Player.CurrentJob == Enums.ClassJobType.{rec.ClassJob.Name.ToString().FirstCharToUpper()}\">");

                string test = "\t\t<While Condition=\"";
                foreach (var ingredient in rec.Ingredients.Where(i => i.Item.Key > 20))
                {
                    test = test + $@"ItemCount({ingredient.Item.Key}) &gt; {ingredient.Count} and ";
                }
                test += $@"Core.Player.CurrentJob == Enums.ClassJobType.{rec.ClassJob.Name.ToString().FirstCharToUpper()}"">";
                OutputInformation(test);

                OutputInformation($"\t\t\t<Synthesize RecipeId=\"{rec.Key}\"/>");

                OutputInformation($"\t\t\t<While Condition=\"CraftingManager.IsCrafting\">");
                OutputInformation(getMacro(actionList, rec.ClassJob.Name.ToString().FirstCharToUpper()));
                OutputInformation("\t\t\t</While>");
                OutputInformation("\t\t</While>\n\t\t</If>\n");
            }

            foreach (var g in DawnGrowMember)
            {
                //   OutputInformation($"{g[0]}, {int.Parse(g[2].ToString().Split('/')[3].Split('.')[0])},  {int.Parse(g[3].ToString().Split('/')[3].Split('.')[0])}");
            }

            OutputInformation($"Quest:");

            foreach (var g in DawnQuestMember.Where(i => i[0] != null))
            {
                //  OutputInformation($"\"{g[0]}\", {int.Parse(g[2].ToString().Split('/')[3].Split('.')[0])}, {int.Parse(g[3].ToString().Split('/')[3].Split('.')[0])}, {g.GetRaw(4)}");
            }

            return(true);
        }
Exemple #18
0
 public ActionResult CreateClass(string Id, string Name, int Numb_Student, string Name_Specialized)
 {
     ClassAction.Add_Class(Id, Name, Numb_Student, Name_Specialized);
     return(Redirect("~/Subject/CreateClass"));
 }
Exemple #19
0
        public override async Task <bool> InvokeAsync(string paramList)
        {
            var DawnQuestMember = _Realm.GameData.GetSheet("DawnQuestMember");
            var DawnContent     = _Realm.GameData.GetSheet("DawnContent");
            var DawnGrowMember  = _Realm.GameData.GetSheet("DawnGrowMember");

            var recipes        = _Realm.GameData.GetSheet <Recipe>();
            var craftaction    = _Realm.GameData.GetSheet <CraftAction>();
            var generalActions = _Realm.GameData.GetSheet <Action>();
            var classes        = _Realm.GameData.GetSheet <ClassJobCategory>();

            var actions = craftaction.Where(row => row.ClassJobCategory.Key != 0 && row.ClassJob != null);
            List <ClassAction> actionList = new List <ClassAction>();

            foreach (var craft in actions)
            {
                //OutputInformation($"{craft.Name} {craft.Key} {craft.ClassJob.Name.ToString()}");
                var temp = new ClassAction(craft.Key, craft.Name.ToString(), craft.ClassJob.Name.ToString().FirstCharToUpper());
                //OutputInformation($"craft: {temp}");
                actionList.Add(temp);
            }

            var genActions = generalActions.Where(row => row.ActionCategory.Key == 7 && row.ClassJob != null && row.ClassJob.Key > 0 && row.ClassJob != null && row.Name != null);

            //OutputInformation($"{genActions.Count()}");
            foreach (var craft in genActions)
            {
                //OutputInformation($"{craft.Key}");
                // OutputInformation($"{craft.Name}"); //{craft.ClassJob.Name.ToString()}");

                var temp = new ClassAction(craft.Key, craft.Name.ToString(), craft.ClassJob.Name.ToString().FirstCharToUpper());
                //OutputInformation($"gen: {temp}");
                actionList.Add(temp);
            }


            var tmp = classes[33];
            int j   = 0;

            foreach (var cl in tmp.ClassJobs)
            {
                string outt = $@"{{""{cl.Name.ToString().FirstCharToUpper()}"", {j}}},";
                //OutputInformation(outt);
                //  Console.WriteLine(outt);
                j++;
            }

            foreach (var rec in recipes.Where(row => row.ResultItem.Name.ToString().Contains("Skybuilders")).OrderBy(r => r.ClassJob.Key))
            {
                string check = $"if (InventoryManager.FilledSlots.Any(i => i.RawItemId == {rec.ResultItem.Key}))\n\tawait test.HandInItem({rec.ResultItem.Key}, {itemIndex[rec.RecipeLevelTable.Key]}, {jobIndex[rec.ClassJob.Name]});\n";
                OutputInformation($"// {rec.ResultItem.Name} ({rec.ClassJob.Name}) ");
                OutputInformation(check);
            }

/*
 *          using (StreamWriter outputFile = new StreamWriter("CraftingActions.json", false))
 *          {
 *              outputFile.Write(JsonConvert.SerializeObject(actionList, Formatting.Indented));
 *          }*/

            foreach (var rec in recipes.Where(row => row.ResultItem.Name.ToString().Contains("Skybuilders")))
            {
                OutputInformation($"{rec.ResultItem.Key},{rec.ResultItem.Name},{rec.ClassJob.Name.ToString().FirstCharToUpper()},{rec.RecipeLevel.RecipeLevelTable.Key}");
            }

            foreach (var g in DawnGrowMember)
            {
                //   OutputInformation($"{g[0]}, {int.Parse(g[2].ToString().Split('/')[3].Split('.')[0])},  {int.Parse(g[3].ToString().Split('/')[3].Split('.')[0])}");
            }

            //OutputInformation($"Quest:");

            foreach (var g in DawnQuestMember.Where(i => i[0] != null))
            {
                //  OutputInformation($"\"{g[0]}\", {int.Parse(g[2].ToString().Split('/')[3].Split('.')[0])}, {int.Parse(g[3].ToString().Split('/')[3].Split('.')[0])}, {g.GetRaw(4)}");
            }

            return(true);
        }