Ejemplo n.º 1
0
        private void InsertPartybutton1_Click(object sender, EventArgs e)
        {
            PartyVO party = new PartyVO();

            party.Name = partyNameTB.Text.Trim();
            //party.Number = (int)IdPartynumericUpDown.Value;

            if (!manager.IsPartyNew(party))
            {
                Error("اسم الجهة أو رقمها موجود سابقاً", "تعذر إضافة جهة جديدة");
                return;
            }
            if (partyNameTB.Text.Trim() == "")
            {
                Error("اسم الجهة لا يمكن أن يكون فارغاً");
                return;
            }
            if (manager.Insert(party) < 0)
            {
                Error("حدث خطأ أثناء عملية إضافة الجهة", "فشل عملية الإضافة");
            }
            else
            {
                bindingSource1.Add(party);
                Message("تم إضافة الجهة بنجاح", "عملية ناجحة");
                IdPartynumericUpDown.Value++;
                partyNameTB.Text = "";
                partyNameTB.Focus();
            }
        }
Ejemplo n.º 2
0
        void GenerateParty(string[] args)
        {
            if (AmbitionApp.GetEvent() != null)
            {
                error("Error: Event already scheduled for today");
                return;
            }
            PartyVO party = new PartyVO()
            {
                RSVP = RSVP.Accepted
            };

            party.Day = AmbitionApp.Calendar.Day;
            for (int i = args.Length - 1; i > 0; --i)
            {
                if (int.TryParse(args[i], out int irsvp) && Enum.IsDefined(typeof(RSVP), irsvp))
                {
                    party.RSVP = (RSVP)irsvp;
                }
                else
                {
                    Enum.TryParse <FactionType>(args[i], true, out party.Faction);
                }
            }
            AmbitionApp.Execute <InitPartyCmd, PartyVO>(party);
            log(AmbitionApp.GetModel <LocalizationModel>().GetPartyName(party) + " successfully created.");
        }
Ejemplo n.º 3
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            PartyVO partyTemp = new PartyVO();

            partyTemp.Id   = party.Id;
            partyTemp.Name = partyNameTB.Text.Trim();
            //partyTemp.Number = (int)IdPartynumericUpDown.Value;

            if (partyNameTB.Text.Trim() == "")
            {
                Error("اسم الجهة لا يمكن أن يكون فارغاً");
            }
            else
            {
                if (!manager.IsPartyNew(partyTemp))
                {
                    Error("هناك جهة أخرى لها نفس الاسم أو الرقم", "فشل تعديل الجهة");
                }
                else
                {
                    if (manager.Update(partyTemp))
                    {
                        party.Name = partyTemp.Name;
                        //party.Number = partyTemp.Number;
                        Message("تم تعديل الجهة بنجاح");
                        DialogResult = System.Windows.Forms.DialogResult.OK;
                    }
                    else
                    {
                        Error();
                    }
                }
            }
        }
 private void FoldercomboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (FoldercomboBox.SelectedIndex >= 0)
     {
         PartyVO current = list[FoldercomboBox.SelectedIndex] as PartyVO;
         //IdPartynumericUpDown.Value = current.Number;
     }
 }
Ejemplo n.º 5
0
        public PartyEditForm(PartyVO p, PartiesManager m)
            : this()
        {
            party   = p;
            manager = m;

            isAutomatic = true;
            //IdPartynumericUpDown.Value = party.Number;
            partyNameTB.Text = party.Name;
            isAutomatic      = false;
        }
Ejemplo n.º 6
0
        private void UpdatePartybutton2_Click(object sender, EventArgs e)
        {
            PartyVO current = bindingSource1.Current as PartyVO;

            if (current != null)
            {
                PartyEditForm form = new PartyEditForm(current, manager);

                if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    PartyDataGridView.Refresh();
                }
            }
        }
Ejemplo n.º 7
0
        private void RemovPartybutton3_Click(object sender, EventArgs e)
        {
            PartyVO current = bindingSource1.Current as PartyVO;

            if (current != null)
            {
                if (Question("هل أنت متأكد من الحذف؟ هذا سيؤدي إلى حذف الملفات العامة و الوثائق و الملفات المرتبطة") == System.Windows.Forms.DialogResult.Yes)
                {
                    if (manager.Delete(current))
                    {
                        bindingSource1.Remove(current);
                        PartyDataGridView.Refresh();
                        Message("تم الحذف بنجاح");
                    }
                    else
                    {
                        Error();
                    }
                }
            }
        }
Ejemplo n.º 8
0
 private List <DocumentVO> FindByParty(PartyVO party)
 {
     return(FindByPartyId(party.Id));
 }
Ejemplo n.º 9
0
 private void HandleRSVP(PartyVO date) => Activate();
Ejemplo n.º 10
0
    private Dictionary <string, Dictionary <int, Dictionary <bool, string> > > _descriptionDictionary; //This absurd thing is so that we can easily feed all the variables in to get descriptions without a giant if statement tree

    public Gossip(PartyVO party) : this(party.Faction)
    {
    }