Example #1
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="effect"></param>
        /// <returns></returns>
        public BaseResult Update(classes classes)
        {
            result.code = 0;
            if (classes.id != 0)
            {
                if (dalClasses.Update(classes) == 0)
                {
                    result.code = -1;
                    result.msg  = "修改失败";
                }
                else
                {
                }
            }
            else
            {
                if (dalClasses.Add(classes) == 0)
                {
                    result.code = -1;
                    result.msg  = "添加失败";
                }
                else
                {
                }
            }

            return(result);
        }
Example #2
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="classes"></param>
 /// <returns></returns>
 public int Update(classes classes)
 {
     return(dbContext.Update <classes>(p => p.id == classes.id, p => new classes()
     {
         name = classes.name
     }));
 }
Example #3
0
 public Classs1(classes c)
 {
     id_class    = c.id_class;
     class_name  = c.class_name;
     image       = c.image;
     description = c.description;
 }
Example #4
0
 /// <summary>
 /// 新增
 /// </summary>
 /// <param name="classes"></param>
 /// <returns></returns>
 public int Add(classes classes)
 {
     return((int)dbContext.Insert <classes>(() => new classes()
     {
         name = classes.name
     }));
 }
Example #5
0
        private ClassDisplayModel BuildModel(classes classEntity)
        {
            if (classEntity == null)
            {
                return(null);
            }
            else
            {
                ClassDisplayModel classmodel = new ClassDisplayModel();
                classmodel.Id        = classEntity.class_id;
                classmodel.Name      = classEntity.class_name;
                classmodel.LastCount = classEntity.last_count;
                classmodel.TypeId    = classEntity.class_type;
                classmodel.TypeName  = classEntity.parentClassTypes.name;
                if (classEntity.start_date.HasValue)
                {
                    classmodel.StartDate = classEntity.start_date.Value.ToString("yyyy-MM-dd");
                }
                else
                {
                    classmodel.StartDate = "1900-01-01";
                }
                if (classEntity.end_date.HasValue)
                {
                    classmodel.EndDate = classEntity.end_date.Value.ToString("yyyy-MM-dd");
                }
                else
                {
                    classmodel.EndDate = "1900-01-01";
                }
                classmodel.IsActive = classEntity.is_active;

                return(classmodel);
            }
        }
Example #6
0
 public IList <StudentDisplayModel> FindStudentsByClassId(int classId)
 {
     try
     {
         Repository <classes> classDal = _unitOfWork.GetRepository <classes>();
         classes cl = classDal.GetObjectByKey(classId).Entity;
         if (cl != null && cl.students != null && cl.students.Count > 0)
         {
             return(BuildModelList(cl.students.ToList()));
         }
         else
         {
             return(new List <StudentDisplayModel>());
         }
     }
     catch (RepositoryException rex)
     {
         string msg    = rex.Message;
         string reason = rex.StackTrace;
         throw new FaultException <LCFault>
                   (new LCFault(msg), reason);
     }
     catch (Exception ex)
     {
         string msg    = ex.Message;
         string reason = ex.StackTrace;
         throw new FaultException <LCFault>
                   (new LCFault(msg), reason);
     }
 }
        public ActionResult Addclasses(classes classes)
        {
            classservice classesservice = new classservice();

            classesservice.saveclasses(classes);
            return(View());
        }
Example #8
0
        /// <summary>
        /// 创建班级信息
        /// </summary>
        /// <param name="newClassEditModel">需要创建的班级信息</param>
        public ClassEditModel Add(ClassEditModel newClassEditModel)
        {
            try
            {
                classes classentity = new classes();

                classentity.class_name = newClassEditModel.Name;
                classentity.class_type = newClassEditModel.TypeId;
                classentity.end_date   = newClassEditModel.EndDate;
                classentity.last_count = newClassEditModel.LastCount;
                classentity.start_date = newClassEditModel.StartDate;
                classentity.is_active  = newClassEditModel.IsActive;

                _unitOfWork.AddAction(classentity, DataActions.Add);
                _unitOfWork.Save();
                newClassEditModel.Id = classentity.class_id;

                return(newClassEditModel);
            }
            catch (RepositoryException rex)
            {
                string msg    = rex.Message;
                string reason = rex.StackTrace;
                throw new FaultException <LCFault>
                          (new LCFault(msg), reason);
            }
            catch (Exception ex)
            {
                string msg    = ex.Message;
                string reason = ex.StackTrace;
                throw new FaultException <LCFault>
                          (new LCFault(msg), reason);
            }
        }
        public ActionResult Editclasses(classes classes)
        {
            classservice classesservice = new classservice();

            classesservice.updateclasses(classes);
            return(View("Addclasses"));
        }
Example #10
0
        /// <summary>
        /// 更新班级信息
        /// </summary>
        /// <param name="newClassEditModel">需要更新的班级信息</param>
        public ClassEditModel Update(ClassEditModel newClassEditModel)
        {
            try
            {
                Repository <classes> classesDal = _unitOfWork.GetRepository <classes>();
                classes classentity             = classesDal.GetObjectByKey(newClassEditModel.Id).Entity;
                if (classentity != null)
                {
                    classentity.class_name = newClassEditModel.Name;
                    classentity.class_type = newClassEditModel.TypeId;
                    classentity.end_date   = newClassEditModel.EndDate;
                    classentity.last_count = newClassEditModel.LastCount;
                    classentity.start_date = newClassEditModel.StartDate;
                    classentity.is_active  = newClassEditModel.IsActive;
                }
                _unitOfWork.AddAction(classentity, DataActions.Update);
                _unitOfWork.Save();

                return(newClassEditModel);
            }
            catch (RepositoryException rex)
            {
                string msg    = rex.Message;
                string reason = rex.StackTrace;
                throw new FaultException <LCFault>
                          (new LCFault(msg), reason);
            }
            catch (Exception ex)
            {
                string msg    = ex.Message;
                string reason = ex.StackTrace;
                throw new FaultException <LCFault>
                          (new LCFault(msg), reason);
            }
        }
Example #11
0
 public ClassEditModel GetClassById(int id)
 {
     try
     {
         ClassEditModel       classEditModel = new ClassEditModel();
         Repository <classes> classesDal     = _unitOfWork.GetRepository <classes>();
         classes classEntity = classesDal.GetObjectByKey(id).Entity;
         if (classEntity != null)
         {
             classEditModel.InitEditModel(classEntity);
         }
         return(classEditModel);
     }
     catch (RepositoryException rex)
     {
         string msg    = rex.Message;
         string reason = rex.StackTrace;
         throw new FaultException <LCFault>
                   (new LCFault(msg), reason);
     }
     catch (Exception ex)
     {
         string msg    = ex.Message;
         string reason = ex.StackTrace;
         throw new FaultException <LCFault>
                   (new LCFault(msg), reason);
     }
 }
Example #12
0
        public void updateclasses(classes classes)
        {
            SMSContext sMSContext = new SMSContext();

            sMSContext.Entry(classes).State = System.Data.Entity.EntityState.Modified;
            sMSContext.SaveChanges();
        }
Example #13
0
        public void saveclasses(classes classes)
        {
            SMSContext sMSContext = new SMSContext();

            sMSContext.classes.Add(classes);
            sMSContext.SaveChanges();
        }
Example #14
0
        //  פונקציה המוסיפה מחלקה לטבלה
        public static void AddCls(Classs1 c)
        {
            oopEntities db  = new oopEntities();
            classes     dtc = Classs1.FromDtoToEntity(c);

            db.classes.Add(dtc);
            db.SaveChanges();
        }
Example #15
0
        public static classes FromDtoToEntity(Classs1 c1)
        {
            classes c = new classes();

            c.id_class    = c1.id_class;
            c.class_name  = c1.class_name;
            c.image       = c1.image;
            c.description = c1.description;
            return(c);
        }
Example #16
0
 public void InitEditModel(classes classesEntity)
 {
     this.Id        = classesEntity.class_id;
     this.EndDate   = classesEntity.end_date.Value;
     this.LastCount = classesEntity.last_count;
     this.Name      = classesEntity.class_name;
     this.StartDate = classesEntity.start_date.Value;
     this.TypeId    = classesEntity.class_type;
     this.TypeName  = classesEntity.parentClassTypes.name;
     this.IsActive  = classesEntity.is_active;
 }
Example #17
0
        public Steel(classes klasa)
        {
            readFromDAT();
            //readFromCSV();
            //saveToDatFile();
            int i = (int)klasa;

            this.Name       = steelNames[i];
            this.fyk        = steelData[i][0];
            this.Es         = steelData[i][1] * 1000;
            this.epsilon_uk = steelData[i][2];
        }
Example #18
0
        /// <summary>
        /// Run the prompt for creating a new student
        /// </summary>
        static void newStudent()
        {
            student NewStudent = new student();

            NewStudent.ID = GetInt("Input the desired student ID: (######)");

            Console.Clear();

            NewStudent.FirstName = GetString("Input the desired student first name: (ABCDXYZ)");

            Console.Clear();

            NewStudent.LastName = GetString("Input the desired student last name: (ABCDXYZ)");

            Console.Clear();

            int classesNum = GetInt("How many classes is the student in? (#)");

            List <classes> newClassList = new List <classes>();

            for (int i = 0; i < classesNum; i++)
            {
                classes newClass = new classes();
                newClass.CourseID     = GetInt("Input course ID: (####)");
                newClass.CourseNumber = GetString("Input course number: (ABCD####");
                newClass.CourseName   = GetString("Input course name: (ABCXYZ)");
                newClass.Credit       = GetInt("Input course credit amount: (#)");
                newClass.Semester     = GetString("Input course semester: (ABCXYZ)");
                newClass.Year         = GetInt("Input course year: (####)");
                newClass.CourseType   = GetString("Input course type: (ABCXYZ)");
                newClass.CourseGrade  = GetString("Input course grade:");
                newClassList.Add(newClass);
            }

            NewStudent.Classes = newClassList;

            students.Add(NewStudent);
            Console.Clear();
            Console.WriteLine("Added New Student:");
            Console.WriteLine("Student Identification Number: " + NewStudent.ID);
            Console.WriteLine("First Name: " + NewStudent.FirstName);
            Console.WriteLine("Last Name: " + NewStudent.LastName);
            Console.WriteLine("Class(es):");
            foreach (var clss in NewStudent.Classes)
            {
                Console.WriteLine(clss.CourseName);
            }

            Console.ReadKey();
            Console.Clear();

            SaveStudents();
        }
Example #19
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        ClassesManage cm = new ClassesManage();
        classes       n  = new classes();

        n.Name      = txt1.Text.Trim();
        n.ClassId   = Convert.ToInt32(txtclassid.Text.Trim());
        n.Term      = DropDownList1.SelectedValue;
        n.TeacherId = DropDownList3.SelectedValue;
        n.Creater   = Session["adminId"].ToString();
        cm.InsertClass(n);
        ScriptManager.RegisterStartupScript(this, this.GetType(), "updateScript", "alert(\"新增成功\");", true);
    }
        public ClassModel(classes dbElement)
        {
            sourcedId        = dbElement.sourcedId;
            status           = dbElement.status;
            dateLastModified = dbElement.dateLastModified;
            title            = dbElement.title;
            classCode        = dbElement.classCode;
            classType        = dbElement.classType;
            location         = dbElement.location;


            grades   = JsonConvert.DeserializeObject <List <string> >(dbElement.grades);
            subjects = JsonConvert.DeserializeObject <List <string> >(dbElement.subjects);

            course = JsonConvert.DeserializeObject <ParentModel>(dbElement.course);
            school = JsonConvert.DeserializeObject <ParentModel>(dbElement.school);
            terms  = JsonConvert.DeserializeObject <List <ParentModel> >(dbElement.terms);
        }
Example #21
0
        /// <summary>
        /// 根据班级类型编号删除班级信息
        /// </summary>
        /// <param name="userCode">班级编号</param>
        public bool DeleteById(int id)
        {
            bool res = true;

            try
            {
                Repository <classes> classesDal = _unitOfWork.GetRepository <classes>();
                classes classentity             = classesDal.GetObjectByKey(id).Entity;
                if (classentity != null)
                {
                    if (classentity.class_schedule.Count > 0)
                    {
                        throw new FaultException <LCFault>(new LCFault("删除班级失败"), "该班级已经编制课程表,无法删除");
                    }
                    else
                    {
                        _unitOfWork.AddAction(classentity, DataActions.Delete);
                        _unitOfWork.Save();
                    }
                }
                else
                {
                    res = false;
                    throw new FaultException <LCFault>(new LCFault("删除班级失败"), "该班级类型不存在,无法删除");
                }
            }
            catch (RepositoryException rex)
            {
                string msg    = rex.Message;
                string reason = rex.StackTrace;
                throw new FaultException <LCFault>
                          (new LCFault(msg), reason);
            }
            catch (Exception ex)
            {
                string msg    = ex.Message;
                string reason = ex.StackTrace;
                throw new FaultException <LCFault>
                          (new LCFault(msg), reason);
            }
            return(res);
        }
Example #22
0
        public ClassEditModel UpdateClassStudents(int classId, List <int> studentIds)
        {
            try
            {
                Repository <classes> classesDal = _unitOfWork.GetRepository <classes>();
                classes classentity             = classesDal.GetObjectByKey(classId).Entity;
                if (classentity != null)
                {
                    classentity.students.Clear();
                    Repository <student> studentDal = _unitOfWork.GetRepository <student>();
                    foreach (int studentId in studentIds)
                    {
                        student studententity = studentDal.GetObjectByKey(studentId).Entity;
                        classentity.students.Add(studententity);
                    }
                }
                _unitOfWork.AddAction(classentity, DataActions.Update);
                _unitOfWork.Save();

                return(GetClassById(classentity.class_id));
            }
            catch (RepositoryException rex)
            {
                string msg    = rex.Message;
                string reason = rex.StackTrace;
                throw new FaultException <LCFault>
                          (new LCFault(msg), reason);
            }
            catch (Exception ex)
            {
                string msg    = ex.Message;
                string reason = ex.StackTrace;
                throw new FaultException <LCFault>
                          (new LCFault(msg), reason);
            }
        }
Example #23
0
 public new void payInvoiceByInternal(classes.Invoice inv, decimal amount)
 {
     base.payInvoiceByInternal(inv, amount) ;
 }
Example #24
0
 public new void payInvoiceByInterac(classes.Invoice inv, decimal amount, int cardID)
 {
     base.payInvoiceByInterac(inv, amount, cardID);
 }
Example #25
0
 public void payInvoiceByCC(classes.Invoice inv, decimal amount, int cardID, enums.ccCardType cardType)
 {
     base.payInvoiceByCC(inv, amount, cardID, cardType);
 }
	public void onBuilderSelectButtonPress(){
		//Char_SelectChar.classNo = 2;
		soldierImage.GetComponent<Image>().enabled = false;
		builderImage.GetComponent<Image>().enabled = true;
		thiefImage.GetComponent<Image>().enabled = false;
		GUIClass = classes.BUILDER;
		spawnPreviewCamera.gameObject.SetActive(true);
		spawnPreviewCamera.transform.localPosition = spawnPreviewBuilderCameraPos.localPosition;
		Debug.Log ("Selecting Builder");
	}
Example #27
0
        //this is the database i made for the races and classes/feats
        static void Main(string[] args)
        {
            DndCharacterData db = new DndCharacterData();

            using (db)
            {
                #region Races
                Race R1 = new Race()
                {
                    RaceID       = 1,                 //set it apart from the others
                    Name         = "Humans",          //name of the race
                    AbilityScore = 1,                 //how many ability points you can apply to each stat
                    Alignment    = "Neutral",         //determines if the race is good or evil(roleplay purposes)
                    Size         = "5'5-6'0(medium)", //Height of the race
                    Speed        = 30,                //how fast the race is(measured in feet)
                    Languages    = "English",         //what languages a race naturally knows starting out
                };
                Race R2 = new Race()
                {
                    RaceID       = 2,
                    Name         = "Dwarves",
                    AbilityScore = 2,
                    Alignment    = "Lawful Good",
                    Size         = "5'0 or lower(small)",
                    Speed        = 25,
                    Languages    = "Dwarvish"
                };
                Race R3 = new Race()
                {
                    RaceID       = 3,
                    Name         = "Elves",
                    AbilityScore = 2,
                    Alignment    = "Chaotic Evil",
                    Size         = "6'1+(Large)",
                    Speed        = 35,
                    Languages    = "Elvish",
                };
                #endregion
                #region Classes
                classes C1 = new classes()
                {
                    Name         = "Fighter",
                    ClassesID    = 1,
                    HitDice      = 10,
                    FirstLevelHP = 10,
                    SavingThrow1 = "Strength",
                    SavingThrow2 = "Constitution",
                    Skill1       = "Acrobatics",
                    Skill2       = "Animal Handeling",
                    Skill3       = "Athletics",
                    Skill4       = "History",
                    Skill5       = "Perception",
                    Skill6       = "Intimidation",
                };
                classes C2 = new classes()
                {
                    Name         = "Bard",
                    ClassesID    = 2,
                    HitDice      = 8,           //determines health
                    FirstLevelHP = 8 + 1,       // determines health at the beginning
                    SavingThrow1 = "Dexterity", //determines what roll the class has an advantage in
                    SavingThrow2 = "Charisma",  //...
                    Skill1       = "Any",       //determines what skills a character can have(roleplay purposes)
                    Skill2       = "Any",
                    Skill3       = "Any",
                    Skill4       = "n/a",
                    Skill5       = "n/a",
                    Skill6       = "n/a",
                };
                classes C3 = new classes()
                {
                    Name         = "Rogue",
                    ClassesID    = 3,
                    HitDice      = 8,
                    FirstLevelHP = 8 + 2,
                    SavingThrow1 = "Dexterity",
                    SavingThrow2 = "Intelligence",
                    Skill1       = "Stealth",
                    Skill2       = "Sleight Of Hand",
                    Skill3       = "Acrobatics",
                    Skill4       = "Athletics",
                    Skill5       = "Deception",
                    Skill6       = "Perception",
                };
                #endregion
                #region Fighter Feats
                Feat F1 = new Feat()
                {
                    Name        = "Fighting style",
                    FeatID      = 1,
                    ClassID     = 1,
                    Level       = 1,
                    Description = "You adopt a particular style of fighting as your specialty. " +
                                  "Choose one of the following options. " +
                                  "You can’t take a Fighting Style option more than once, even if you later get to choose again." +
                                  "Archery: You gain a +2 bonus to attack rolls you make with ranged weapons." +
                                  "Defense:While you are wearing armor, you gain a +1 bonus to AC." +
                                  "Dueling:When you are wielding a melee weapon in one hand and no other weapons, you gain a +2 bonus to damage rolls with that weapon." +
                                  "Great Weapon Fighting:When you roll a 1 or 2 on a damage die for an attack you make with a melee weapon that you are wielding with two hands, " +
                                  "you can reroll the die and must use the new roll, even if the new roll is a 1 or a 2. " +
                                  "The weapon must have the two-handed or versatile property for you to gain this benefit." +
                                  "Protection:When a creature you can see attacks a target other than you that is within 5 feet of you, you can use your reaction to impose disadvantage on the attack roll." +
                                  " You must be wielding a shield." +
                                  "Two-Weapon Fighting:When you engage in two-weapon fighting, you can add your ability modifier to the damage of the second attack."
                };
                Feat F2 = new Feat()
                {
                    Name        = "Second Wind",
                    FeatID      = 2,
                    ClassID     = 1,
                    Level       = 1,
                    Description = "You have a limited well of stamina that you can draw on to protect yourself from harm. On your turn, you can use a bonus action to regain hit points equal to 1d10 + your fighter level. Once you use this feature, you must finish a short or long rest before you can use it again"
                };
                Feat F3 = new Feat()
                {
                    Name        = "Action Surge",
                    FeatID      = 3,
                    ClassID     = 1,
                    Level       = 2,
                    Description = "Starting at 2nd level, you can push yourself beyond your normal limits for a moment. On your turn, you can take one additional action." +
                                  "Once you use this feature, you must finish a short or long rest before you can use it again. Starting at 17th level, you can use it twice before a rest, but only once on the same turn."
                };
                Feat F4 = new Feat()
                {
                    Name        = "Martial Archetype",
                    FeatID      = 4,
                    ClassID     = 1,
                    Level       = 3,
                    Description = "At 3rd level, you choose an archetype that you strive to emulate in your combat styles and techniques. Choose Champion, Battle Master, or Eldritch Knight"
                };
                Feat F5 = new Feat()
                {
                    Name        = "Ability Scores",
                    FeatID      = 5,
                    ClassID     = 1,
                    Level       = 4,
                    Description = "When you reach 4th level, and again at 6th, 8th, 12th, 14th, 16th, and 19th level, " +
                                  "you can increase one ability score of your choice by 2, or you can increase two ability scores of your choice by 1. " +
                                  "As normal, you can’t increase an ability score above 20 using this feature."
                };
                Feat F6 = new Feat()
                {
                    Name        = "Extra Attack",
                    FeatID      = 6,
                    ClassID     = 1, //what class the feat belongs in
                    Level       = 5, //what level you get the feat at
                    Description = "Beginning at 5th level, you can attack twice, instead of once, whenever you take the Attack action on your turn." +
                                  "The number of attacks increases to three when you reach 11th level in this class and to four when you reach 20th level in this class."
                                  //the general description of what the feat does
                };
                Feat F7 = new Feat()
                {
                    Name        = "Indomitable",
                    FeatID      = 7,
                    ClassID     = 1,
                    Level       = 9,
                    Description = "Beginning at 9th level, you can reroll a saving throw that you fail. If you do so, you must use the new roll, and you can’t use this feature again until you finish a long rest." +
                                  "You can use this feature twice between long rests starting at 13th level and three times between long rests starting at 17th level."
                };

                #endregion
                #region Bard Feats
                Feat F8 = new Feat()
                {
                    Name        = "SpellCasting",
                    FeatID      = 8,
                    ClassID     = 2,
                    Level       = 1,
                    Description = "You have learned to untangle and reshape the fabric of reality in harmony with your wishes and music." +
                                  " Your spells are part of your vast repertoire, magic that you can tune to different situations. See Spells Rules for " +
                                  "the general rules of spellcasting and the Spells Listing for the bard spell list."
                };
                Feat F9 = new Feat()
                {
                    Name        = "Bardic inspiration",
                    FeatID      = 9,
                    ClassID     = 2,
                    Level       = 2,
                    Description = "You can inspire others through stirring words or music. " +
                                  "To do so, you use a bonus action on your turn to choose one creature other than yourself within 60 feet of you who can hear you." +
                                  " That creature gains one Bardic Inspiration die, a d6" +
                                  "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, " +
                                  "attack roll, or saving throw it makes. The creature can wait until after it rolls the d20 before deciding to use the Bardic Inspiration die, " +
                                  "but must decide before the DM says whether the roll succeeds or fails. Once the Bardic Inspiration die is rolled, it is lost. A creature can have only one Bardic Inspiration die at a time." +
                                  "You can use this feature a number of times equal to your Charisma modifier (a minimum of once). You regain any expended uses when you finish a long rest" +
                                  "Your Bardic Inspiration die changes when you reach certain levels in this class. The die becomes a d8 at 5th level, a d10 at 10th level, and a d12 at 15th level"
                };
                Feat F10 = new Feat()
                {
                    Name        = "Bard College",
                    FeatID      = 10,
                    ClassID     = 2,
                    Level       = 3,
                    Description = "At 3rd level, you delve into the advanced techniques of a bard college of your choice: " +
                                  "the College of Lore detailed at the end of the class description or another from the Player's Handbook or other sources. " +
                                  "Your choice grants you features at 3rd level and again at 6th and 14th level."
                };
                Feat F11 = new Feat()
                {
                    Name        = "Expertise",
                    FeatID      = 11,
                    ClassID     = 2,
                    Level       = 3,
                    Description = "At 3rd level, choose two of your skill proficiencies. " +
                                  "Your proficiency bonus is doubled for any ability check you make that uses either of the chosen proficiencies." +
                                  "This Feat also happens at Level 10."
                };
                Feat F12 = new Feat()
                {
                    Name        = "Ability Score Improvement",
                    FeatID      = 12,
                    ClassID     = 2,
                    Level       = 4,
                    Description = "When you reach 4th level, and again at 8th, 12th, 16th, and 19th level, you can increase one ability score " +
                                  "of your choice by 2, or you can increase two ability scores of your choice by 1. As normal, you can’t increase an ability score " +
                                  "above 20 using this feature"
                };
                Feat F13 = new Feat()
                {
                    Name        = "Font of Inspiration",
                    FeatID      = 13,
                    ClassID     = 2,
                    Level       = 5,
                    Description = "Beginning when you reach 5th level, you regain all of your expended uses of Bardic Inspiration when you finish a short or long rest"
                };
                Feat F14 = new Feat()
                {
                    Name        = "Countercharm",
                    FeatID      = 14,
                    ClassID     = 2,
                    Level       = 6,
                    Description = "At 6th level, you gain the ability to use musical notes or words of power to disrupt mind-influencing effects. " +
                                  "As an action, you can start a performance that lasts until the end of your next turn. During that time, you and any friendly creatures within 30 feet of you have advantage on saving throws against being frightened " +
                                  "or charmed. A creature must be able to hear you to gain this benefit. The performance ends early if you are incapacitated or silenced or if you voluntarily end it (no action required)."
                };
                Feat F15 = new Feat()
                {
                    Name        = "Magical Secrets",
                    FeatID      = 15,
                    ClassID     = 2,
                    Level       = 10,
                    Description = "By 10th level, you have plundered magical knowledge from a wide spectrum of disciplines. Choose two spells from any classes, including this one. A spell you choose must be of a level you can cast, as shown on the Bard table, or a cantrip." +
                                  "The chosen spells count as bard spells for you and are included in the number in the Spells Known column of the Bard table" +
                                  "You learn two additional spells from any classes at 14th level and again at 18th level."
                };
                Feat F16 = new Feat()
                {
                    Name        = "Superior Inspiration",
                    FeatID      = 16,
                    ClassID     = 2,
                    Level       = 20,
                    Description = "At 20th level, when you roll initiative and have no uses of Bardic Inspiration left, you regain one use."
                };
                #endregion
                #region Rogue Feats
                Feat F17 = new Feat()
                {
                    Name        = "Expertise",
                    FeatID      = 17,
                    ClassID     = 3,
                    Level       = 1,
                    Description = "At 1st level, choose two of your skill proficiencies, or one of your skill proficiencies and your proficiency with thieves’ tools." +
                                  " Your proficiency bonus is doubled for any ability check you make that uses either of the chosen proficiencies." +
                                  "This feat takes effect in 6th level also."
                };
                Feat F18 = new Feat()
                {
                    Name        = "Sneak Attack",
                    FeatID      = 18,
                    ClassID     = 3,
                    Level       = 1,
                    Description =
                        "Beginning at 1st level, you know how to strike subtly and exploit a foe’s distraction. " +
                        "Once per turn, you can deal an extra 1d6 damage to one creature you hit with an attack if you have advantage on the attack roll." +
                        " The attack must use a finesse or a ranged weapon." +
                        "You don’t need advantage on the attack roll if another enemy of the target is within 5 feet of it, " +
                        "that enemy isn’t incapacitated, and you don’t have disadvantage on the attack roll." +
                        "The amount of the extra damage increases as you gain levels in this class, as shown in the Sneak Attack column of the Rogue table."
                };
                Feat F19 = new Feat()
                {
                    Name        = "Roguish Archetype",
                    FeatID      = 19,
                    ClassID     = 3,
                    Level       = 3,
                    Description =
                        "At 3rd level, you choose an archetype that you emulate in the exercise of your rogue abilities: " +
                        "Thief, detailed at the end of the class description, or one from another source. Your archetype choice " +
                        "grants you features at 3rd level and then again at 9th, 13th, and 17th level."
                };
                Feat F20 = new Feat()
                {
                    Name        = "Ability Score Improvement",
                    FeatID      = 20,
                    ClassID     = 3,
                    Level       = 4,
                    Description =
                        "When you reach 4th level, and again at 8th, 10th, 12th, 16th, and 19th level, you can increase one ability score of your choice by 2, or you can increase " +
                        "two ability scores of your choice by 1. As normal, you can’t increase an ability score above 20 using this feature."
                };
                Feat F21 = new Feat()
                {
                    Name        = "Uncanny Dodge",
                    FeatID      = 21,
                    ClassID     = 3,
                    Level       = 5,
                    Description =
                        "Starting at 5th level, when an attacker that you can see hits you with an attack, you can use your reaction to halve the attack’s damage against you."
                };
                Feat F22 = new Feat()
                {
                    Name        = "Evasion",
                    FeatID      = 22,
                    ClassID     = 3,
                    Level       = 7,
                    Description =
                        "Beginning at 7th level, you can nimbly dodge out of the way of certain area effects," +
                        " such as an ancient red dragon’s fiery breath or an ice storm spell. When you are subjected to an " +
                        "effect that allows you to make a Dexterity saving throw to take only half damage, you instead take no damage if you succeed on the saving throw," +
                        " and only half damage if you fail."
                };
                Feat F23 = new Feat()
                {
                    Name        = "Reliable Talent",
                    FeatID      = 23,
                    ClassID     = 3,
                    Level       = 11,
                    Description =
                        "By 11th level, you have refined your chosen skills until they approach perfection. Whenever you make an ability check that lets you add your proficiency bonus, " +
                        "you can treat a d20 roll of 9 or lower " +
                        "as a 10"
                };
                Feat F24 = new Feat()
                {
                    Name        = "Blindsense",
                    FeatID      = 24,
                    ClassID     = 3,
                    Level       = 14,
                    Description =
                        "Starting at 14th level, if you are able to hear, you are aware of the location of any hidden or invisible creature within 10 feet of you."
                };
                Feat F25 = new Feat()
                {
                    Name        = "Slippery Mind",
                    FeatID      = 25,
                    ClassID     = 3,
                    Level       = 15,
                    Description =
                        "By 15th level, you have acquired greater mental strength. You gain proficiency in Wisdom saving throws"
                };
                Feat F26 = new Feat()
                {
                    Name        = "Elusive",
                    FeatID      = 26,
                    ClassID     = 3,
                    Level       = 18,
                    Description =
                        "Beginning at 18th level, you are so evasive that attackers rarely gain the upper hand against you. No attack roll has advantage against you while you aren’t incapacitated."
                };
                Feat F27 = new Feat()
                {
                    Name        = "Stroke Of Luck",
                    FeatID      = 27,
                    ClassID     = 3,
                    Level       = 20,
                    Description =
                        "At 20th level, you have an uncanny knack for succeeding when you need to. If your attack misses a target within range, you can turn the miss into a hit. " +
                        "Alternatively, if you fail an ability check, you can treat the d20 roll as a 20." +
                        "Once you use this feature, you can’t use it again until you finish a short or long rest."
                };



                #endregion
                db.Races.Add(R1);
                db.Races.Add(R2);
                db.Races.Add(R3);
                Console.WriteLine("DnD Races added");
                db.Classes.Add(C1);
                db.Classes.Add(C2);
                db.Classes.Add(C3);
                Console.WriteLine("Dnd Character Classes added");
                db.Feats.Add(F1);
                db.Feats.Add(F2);
                db.Feats.Add(F3);
                db.Feats.Add(F4);
                db.Feats.Add(F5);
                db.Feats.Add(F6);
                db.Feats.Add(F7);
                db.Feats.Add(F8);
                db.Feats.Add(F9);
                db.Feats.Add(F10);
                db.Feats.Add(F11);
                db.Feats.Add(F12);
                db.Feats.Add(F13);
                db.Feats.Add(F14);
                db.Feats.Add(F15);
                db.Feats.Add(F16);
                db.Feats.Add(F17);
                db.Feats.Add(F18);
                db.Feats.Add(F19);
                db.Feats.Add(F20);
                db.Feats.Add(F21);
                db.Feats.Add(F22);
                db.Feats.Add(F23);
                db.Feats.Add(F24);
                db.Feats.Add(F25);
                db.Feats.Add(F26);
                db.Feats.Add(F27);
                Console.WriteLine("DND feats added");
                db.SaveChanges();
                Console.WriteLine("Saved to database");
            }
        }
        // בלחיצה על כפתור שבץ יופעל פונקציה של השיבוצים השונים ותגדיר רשימה של שיבוצים והפונקציה תפעיל על כל שיבוץ ברשימה פונקצית הערכה ותבחר את השיבוץ הטוב ביותר ואותו תשמור בפונקצית השיבוצים
        //ברגע שהאמא הגיע הוא בודק מה התור הקרוב ביותר ומעדכן את השיבוץ של הכיתות השונות
        //לשקול בהמשך אם כדאי להוסיף פונקציה לשיפור של שיבוץ קיים



        //פונקצית זמן אמת מקבלת קוד הורה ןבודקת האם כדאי לשנות את התור
        public schedulingDTO FuncRealTime(string id)
        {
            List <scheduling> s      = new List <scheduling>();
            schedulingDTO     sn     = new schedulingDTO();
            List <classes>    c      = new List <classes>();
            classes           shortQ = new classes();
            var p = new PARENTSEntities();

            //שליפה ל כל השיבוצים של הבנות שהאמא עדיין לא נכנסה ומיון לפי שעה
            s = p.scheduling.Where(x => x.studens.id_parent == id && x.hour_exit == null)
                .OrderBy(f => f.hour_).ToList();
            c = get_classes(id);
            //אם להורה יש יותר מילד אחד יש לבדוק באיזה כיתה התור קצר יותר ואם צריך להחליף
            if (s.Count() > 1)
            {
                for (int i = 0; i < s.Count; i++)
                {
                    //עדכון שעת הגעה
                    if (s[i].hour_reach == null)
                    {
                        s[i].hour_reach = DateTime.Now.TimeOfDay;
                    }
                    schedulingDAL.UpdateScheduling(s[i]);
                }

                shortQ = getShortClass(c);

                if (s[0].code_class != shortQ.code)
                {
                    scheduling        n = new scheduling();
                    List <scheduling> l = new List <scheduling>();
                    n = s.Where(f => f.code_class == shortQ.code).FirstOrDefault();
                    //תור ההורים שהגיעו ממוין לפי שעות
                    l = p.scheduling.Where(x => x.hour_reach != null && x.hour_enter == null &&
                                           x.studens.code_class == shortQ.code).OrderBy(v => v.hour_).ToList();
                    //אם הגיע ראשון
                    if (l.Count == 1)
                    {
                        sn.idMother    = id;
                        sn.nameMother  = s.First().studens.parents.first_name;
                        sn.code_class  = shortQ.code;
                        sn.nameStudent = s.First().studens.first_name + " " + s.First().studens.last_name;
                        sn.class_      = shortQ.class_ + " " + shortQ.num_class;
                        return(sn);
                    }
                    //בדיקה האם הגיעה השעה בכיתה אחרת

                    foreach (scheduling item in s)
                    {
                        if (item.hour_.Hours == DateTime.Now.Hour && item.hour_.Minutes == DateTime.Now.Minute)
                        {
                            if (l.Count == 1)
                            {
                                var     f    = new PARENTSEntities();
                                classes clas = f.classes.Where(j => j.code == item.code_class).FirstOrDefault();
                                sn.nameMother  = s.First().studens.parents.first_name;
                                sn.idMother    = id;
                                sn.code_class  = item.code_class;
                                sn.nameStudent = s.First().studens.first_name + " " + s.First().studens.last_name;
                                sn.class_      = clas.class_ + " " + clas.num_class;
                                return(sn);
                            }
                        }
                    }
                    scheduling b = l.Where(u => u.hour_ == l.Max(t => t.hour_)).First();
                    TimeSpan   a = new TimeSpan(b.hour_.Hours, b.hour_.Minutes + 10, 00);
                    n.hour_ = a;
                    schedulingDAL.UpdateScheduling(n);
                    sn.hour_       = n.hour_;
                    sn.nameStudent = s.First().studens.first_name + " " + s.First().studens.last_name;
                    sn.class_      = shortQ.class_ + " " + shortQ.num_class;
                    return(sn);
                }
            }
            else
            {
                //עדכון שעת הגעה לשעה הנוכחית אם יש ילד אחד להורה
                if (s.First().hour_reach == null)
                {
                    s.First().hour_reach = DateTime.Now.TimeOfDay;
                }
                schedulingDAL.UpdateScheduling(s.First());
                sn.nameMother  = s.First().studens.parents.first_name;
                sn.idMother    = id;
                sn.nameStudent = s.First().studens.first_name + " " + s.First().studens.last_name;
                sn.class_      = c.First().class_ + " " + c.First().num_class;
                return(sn);
            }

            return(sn);
        }
        public void updateCurrentlyCamera(classes.PropertyEventArgs p)
        {
            switch (p.PropertyName)
            {
                case EDSDK.PropID_Tv: // Wenn sich die Eigenschaft Belichtungszeit aendert
                    {
                        this.CurrentCamera.getShutterTime();
                        this.CurrentTv = this.shutterTimeConverter.getShutterTimeStringFromHex(this.currentCamera.CameraShutterTime);
                        break;
                    }
                case EDSDK.PropID_ISOSpeed: // Wenn sich die Eigenschaft ISO aendert
                    {
                        this.CurrentCamera.getIsoSpeed();
                        this.CurrentISO = this.isoConverter.getISOSpeedFromHex(this.currentCamera.CameraISOSpeed);
                        break;
                    }
                case EDSDK.PropID_AvailableShots: //Wenn sich die Eigenschaft Anzahl der freien Fotos aendert
                    {
                        this.currentCamera.getAvailableShots();
                        this.CurrentAvailableShots = (int)this.currentCamera.CameraAvailableShots;
                        break;
                    }
                case EDSDK.PropID_BatteryLevel:
                    {
                        this.currentCamera.getBatteryLevel();
                        this.CurrentBatteryLevel = (int)this.currentCamera.CameraBatteryLevel;
                        break;
                    }
                case EDSDK.PropID_FirmwareVersion:
                    {
                        this.currentCamera.getFirmwareVersion();
                        this.CurrentCameraFirmware = this.currentCamera.CameraFirmware;
                        break;
                    }

                case EDSDK.PropID_ProductName:
                    {
                        this.currentCamera.getName();
                        this.CurrentCameraName = this.currentCamera.Name;
                        break;
                    }
                case EDSDK.PropID_OwnerName:
                    {
                        this.currentCamera.getOwner();
                        this.CurrentCameraOwner = this.currentCamera.Owner;
                        break;
                    }
                case EDSDK.PropID_BodyIDEx:
                    {
                        this.currentCamera.getBodyID();
                        this.CurrentBodyID = this.currentCamera.BodyID;
                        break;
                    }
                case EDSDK.PropID_AEMode:
                    {
                        this.currentCamera.getAeMode();
                        this.CurrentProgramm = this.AeModeConverter.getAEString(this.CurrentCamera.CameraAEMode);
                        if (this.CurrentCamera.CameraAEMode == 1)
                        {
                            updatePropertyDescTv();
                            updatePropertyDescEBV();
                            delPropertyDescAperturesFromCollection();
                        }
                        if (this.CurrentCamera.CameraAEMode == 2)
                        {
                            updatePropertyDescAv();
                            updatePropertyDescEBV();
                            delPropertyDescShutterTimesFromCollection();
                        }
                        if (this.CurrentCamera.CameraAEMode == 3)
                        {
                            updatePropertyDescTv();
                            updatePropertyDescAv();
                            delPropertyDescEbvFromCollection();
                        }
                        break;
                    }
                case EDSDK.PropID_Av:
                    {
                        this.currentCamera.getApertureFromCamera();
                        this.CurrentAperture = this.apertureConverter.getApertureString(this.CurrentCamera.CameraAperture);
                        break;
                    }
                case EDSDK.PropID_DateTime:
                    {
                        this.CurrentCamera.getTime();
                        this.CurrentDate = convertEdsTimeToDateString(this.CurrentCamera.CameraTime);
                        this.CurrentTime = convertEdsTimeToTimeString(this.CurrentCamera.CameraTime);
                        break;
                    }
                case EDSDK.PropID_ExposureCompensation:
                    {
                        this.CurrentCamera.getEbvFromBody();
                        this.CurrentEBV = this.EbvConverter.getEbvString(this.CurrentCamera.CameraExposureCompensation);
                        break;
                    }
                case EDSDK.PropID_DriveMode:
                    {
                        this.CurrentCamera.getDriveMode();
                        this.DriveMode = this.DriveModeConverter.getDriveModeString(this.CurrentCamera.CameraDriveMode);
                        break;
                    }
                case EDSDK.PropID_MeteringMode:
                    {
                        this.CurrentCamera.getMeteringMode();
                        this.MeteringMode = this.MeteringModeConverter.getMeteringModeString(this.CurrentCamera.CameraMeteringMode);
                        break;
                    }
                case EDSDK.PropID_AFMode:
                    {
                        this.CurrentCamera.getAfMode();
                        this.AfMode = this.AfModeConverter.getAfModeString(this.CurrentCamera.CameraAFMode);
                        break;
                    }
                default:
                    {
                        Console.WriteLine("Cant identify PropertyID");
                        break;
                    }
            }
        }
Example #30
0
        /// <summary>
        /// 更新学员信息
        /// </summary>
        /// <param name="newClassEditModel">需要更新的学员信息</param>
        public StudentEditModel Update(StudentEditModel newStudentEditModel)
        {
            try
            {
                Repository <student> studentModuleDal = _unitOfWork.GetRepository <student>();
                student studententity = studentModuleDal.GetObjectByKey(newStudentEditModel.Id).Entity;
                if (studententity != null)
                {
                    studententity.address            = newStudentEditModel.Address;
                    studententity.center_id          = newStudentEditModel.CenterId;
                    studententity.dads_name          = newStudentEditModel.Dadsname;
                    studententity.dads_phone         = newStudentEditModel.Dadsphone;
                    studententity.email              = newStudentEditModel.Email;
                    studententity.extra_info         = newStudentEditModel.ExtraInfo;
                    studententity.google_contacts_id = newStudentEditModel.GoogleContactsId;
                    studententity.grade              = newStudentEditModel.Grade;
                    studententity.moms_name          = newStudentEditModel.Momsname;
                    studententity.moms_phone         = newStudentEditModel.Momsphone;
                    studententity.original_class     = newStudentEditModel.OriginalClass;
                    studententity.relationship       = newStudentEditModel.RelationShip;
                    studententity.remaining_balance  = newStudentEditModel.RemainingBalance;
                    studententity.rfid_tag           = newStudentEditModel.RfidTag;
                    studententity.school             = newStudentEditModel.School;
                    studententity.students_birthdate = newStudentEditModel.Birthdate;
                    studententity.students_name      = newStudentEditModel.Name;
                    studententity.students_nickname  = newStudentEditModel.Nickname;
                    studententity.student_id         = newStudentEditModel.Id;
                    studententity.status             = newStudentEditModel.StatusId;

                    if (studententity.consultants.Count > 0)
                    {
                        studententity.consultants.Clear();
                    }

                    if (newStudentEditModel.ConsultantId != 0)
                    {
                        Repository <consultant> consultantModuleDal = _unitOfWork.GetRepository <consultant>();
                        consultant consultantEntity = consultantModuleDal.GetObjectByKey(newStudentEditModel.ConsultantId).Entity;
                        studententity.consultants.Add(consultantEntity);
                    }

                    if (newStudentEditModel.ConsultantRate != 0)
                    {
                        studententity.consultant_check_rate = newStudentEditModel.ConsultantRate;
                    }

                    studententity.classess.Clear();
                    if (newStudentEditModel.ClassesId != null)
                    {
                        Repository <classes> classesDal = _unitOfWork.GetRepository <classes>();
                        foreach (int classid in newStudentEditModel.ClassesId)
                        {
                            classes cls = classesDal.GetObjectByKey(classid).Entity;
                            studententity.classess.Add(cls);
                        }
                    }
                }

                _unitOfWork.AddAction(studententity, DataActions.Update);
                _unitOfWork.Save();

                return(newStudentEditModel);
            }
            catch (RepositoryException rex)
            {
                string msg    = rex.Message;
                string reason = rex.StackTrace;
                throw new FaultException <LCFault>
                          (new LCFault(msg), reason);
            }
            catch (Exception ex)
            {
                string msg    = ex.Message;
                string reason = ex.StackTrace;
                throw new FaultException <LCFault>
                          (new LCFault(msg), reason);
            }
        }
 /// <summary>
 /// 更新班级信息
 /// </summary>
 /// <param name="n">班级信息实体类</param>
 /// <returns></returns>
 public void UpdateClass(classes n)
 {
     ndao.UpdateClass(n);
 }
        public TS_concrete(classes klasa)
        {
            switch ((int)klasa)
            {
            case 0:
                fck  = 12;
                Name = "C12/15";
                break;

            case 1:
                fck  = 16;
                Name = "C16/20";
                break;

            case 2:
                fck  = 20;
                Name = "C20/25";
                break;

            case 3:
                fck  = 25;
                Name = "C25/30";
                break;

            case 4:
                fck  = 30;
                Name = "C30/37";
                break;

            case 5:
                fck  = 35;
                Name = "C35/45";
                break;

            case 6:
                fck  = 40;
                Name = "C40/50";
                break;

            case 7:
                fck  = 45;
                Name = "C45/55";
                break;

            case 8:
                fck  = 50;
                Name = "C50/60";
                break;

            case 9:
                fck  = 55;
                Name = "C55/67";
                break;

            case 10:
                fck  = 60;
                Name = "C60/75";
                break;

            case 11:
                fck  = 70;
                Name = "C70/85";
                break;

            case 12:
                fck  = 80;
                Name = "C80/95";
                break;

            case 13:
                fck  = 90;
                Name = "C90/105";
                break;

            default:
                fck  = 0;
                Name = "error";
                break;
            }

            SetFactors(fck);
        }
Example #33
0
 /// <summary>
 /// Just for entittyType {person,Organization}
 /// </summary>
 /// <param name="inv"></param>
 /// <param name="amount"></param>
 /// <param name="cardID"></param>
 /// <param name="cardType"></param>
 protected void payInvoiceByInterac(classes.Invoice inv, decimal amount, int cardID)
 {
     inv.doINTERACPayment(amount, cardID);
 }
Example #34
0
 /// <summary>
 /// Just for entittyType {person,Organization}
 /// </summary>
 /// <param name="inv"></param>
 /// <param name="amount"></param>
 /// <param name="cardID"></param>
 /// <param name="cardType"></param>
 protected void payInvoiceByInternal(classes.Invoice inv, decimal amount)
 {
     inv.doINTERNALTransfer(amount);
 }
 /// <summary>
 /// 新增班级
 /// </summary>
 /// <param name="n">班级信息实体类</param>
 /// <returns></returns>
 public bool InsertClass(classes  n)
 {
     return ndao.InsertClass(n);
 }
Example #36
0
 /// <summary>
 /// Just for entittyType {person,Organization}
 /// </summary>
 /// <param name="inv"></param>
 /// <param name="amount"></param>
 /// <param name="cardID"></param>
 /// <param name="cardType"></param>
 protected void payInvoiceByCC(classes.Invoice inv, decimal amount, int cardID, enums.ccCardType cardType)
 {
     inv.doCCExtPayment(amount, cardID, cardType);
 }
 new ListErrorDisplayStyle(classes: CssElementCreator.TopErrorMessageListContainerClass)).ToCollection()
 /// <summary>
 /// 删除班级
 /// </summary>
 /// <param name="n">班级信息实体类</param>
 /// <returns></returns>
 public bool DeleteClass(classes n)
 {
     return ndao.DeleteClass(n);
 }