Example #1
0
        public void addPPGD(string id, PPGD ppgd)
        {
            var   obId      = ObjectId.GenerateNewId();
            CPPGD cPPGD     = new CPPGD();
            var   PPGDExist = cPPGD.findfromsubject(id);

            if (!(PPGDExist is null))
            {
                PPGDExist.PPGD.Add(ppgd);
                this.mongo.Update <PPGDs>("PPGDs", PPGDExist._id, PPGDExist);
            }
Example #2
0
        public UCPPGDsEdit(string subId, string PPGDId, Panel pnl_container, string isAdmin)
        {
            InitializeComponent();
            count              = 0;
            this.isAdmin       = isAdmin;
            this.subId         = subId;
            this.PPGDId        = PPGDId;
            this.pnl_container = pnl_container;
            ppgd = cPPGD.findfromsubject(subId).PPGD.Where(c => c.ID == PPGDId).SingleOrDefault();
            this.txt_PPGDID.Text = ppgd.ID;
            this.txt_Detail.Text = ppgd.Detail[0].ToString();

            details = ppgd.Detail;
            max     = ppgd.Detail.Count();
            if (max != 0)
            {
                min = 1;
            }
            else
            {
                min = 0;
            }
        }