Exemple #1
0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(ADR_Group.Get_cmdTP());
            if (this.GroupName.ValueChanged)
            {
                upd.AddValue("GroupName", this.GroupName);
            }
            if (this.Group_LeaderSID.ValueChanged)
            {
                upd.AddValue("Group_LeaderSID", this.Group_LeaderSID);
            }
            if (this.Group_Email.ValueChanged)
            {
                upd.AddValue("Group_Email", this.Group_Email);
            }

            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("GroupID", HssUtility.General.RelationalOperator.Equals, this.pk_ID);
            upd.SetCondition(rela);

            return(upd);
        }
Exemple #2
0
        /*---------------------------------------------------------------------------------------------------------*/

        private static void Init_group_dic()
        {
            DB_select selt   = new DB_select(ADR_Group.Get_cmdTP());
            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                ADR_Group ag = new ADR_Group();
                ag.Init_from_reader(reader);

                TaskMemberMaster.group_dic[ag.GroupID] = ag;
            }
            reader.Close();
        }
Exemple #3
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (this.GroupID < 0)
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(ADR_Group.Get_cmdTP());
            db_sel.tableName = "ADR_Group";
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("GroupID", HssUtility.General.RelationalOperator.Equals, this.GroupID);
            db_sel.SetCondition(rela);

            bool res_flag = false;

            HssUtility.SQLserver.DB_reader reader = new HssUtility.SQLserver.DB_reader(db_sel, Utility.Get_DRWIN_hDB());
            if (reader.Read())
            {
                this.Init_from_reader(reader);
                res_flag = true;
            }
            reader.Close();
            return(res_flag);
        }
Exemple #4
0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(ADR_Group.Get_cmdTP());

            dbIns.AddValue("GroupName", this.GroupName.Value);
            dbIns.AddValue("Group_LeaderSID", this.Group_LeaderSID.Value);
            dbIns.AddValue("Group_Email", this.Group_Email);/*Optional 4*/

            return(dbIns);
        }