public BankFish(Project P)
 {
     State = States.WritePro;
     Pro = P;
     InitializeComponent();
     Btn_Edit.Enabled = Btn_Delete.Enabled = false;
 }
 public CardtoCard(Project P)
 {
     State = States.WritePro;
     Pro = P;
     InitializeComponent();
     Btn_Edit.Enabled = Btn_Del.Enabled = false;
 }
 private void Register()
 {
     try
     {
         Project P = new Project()
         {
             ProjectID = Convert.ToInt32(Txt_ProjectID.Text.Trim()),
             ProjectName = Txt_PName.Text.Trim(),
             ProjectStart = Calendar1.GeoDate.Value,
             ProjectArea = Txt_PArea.Text.Trim(),
             ProjectDescribed = Txt_PDesc.Text.Trim(),
             Emp_Name = Txt_Em.Text.Trim(),
             isActive = true,
             TotalCost = 0,
             TotalInCome = 0
         };
         db.Projects.Add(P);
         db.SaveChanges();
     }
     catch (DbUpdateException ex)
     {
         MessageBox.Show(SqlServerErrorManagment.ShowError(ex, "پروژه"));
     }
 }
 public Form_Payment(Project Pr)
 {
     State = States.WritePro;
     Pro = Pr;
     InitializeComponent();
 }
 private void GetData()
 {
     project = db.Projects.Include(p => p.Persons).Single(p => p.ProjectID == id);
 }
 private void Combo_Project_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (Combo_Project.SelectedIndex != -1)
     {
         int idproject = Convert.ToInt32(Combo_Project.SelectedValue);
         project = _db.Projects.SingleOrDefault(p => p.ProjectID == idproject);
         FillComboPerson();
         if (project != null)
         {
             FillGrid(project.Persons.ToList());
             _listPerson = project.Persons.ToList();
         }
         _plus = new List<Person>();
         _Minus = new List<int>();
     }
 }