Пример #1
0
        private static void Init_owner_dic()
        {
            DB_select selt   = new DB_select(ADR_TaskOwner.Get_cmdTP());
            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                ADR_TaskOwner ato = new ADR_TaskOwner();
                ato.Init_from_reader(reader);

                string ownerSID = ato.OwnerSID.Value;
                TaskMemberMaster.owner_dic[ownerSID] = ato;
                if (!TaskMemberMaster.groupMember_dic.ContainsKey(ownerSID))
                {
                    continue;
                }

                int groupID = TaskMemberMaster.groupMember_dic[ownerSID].GroupID.Value;
                if (!TaskMemberMaster.ownerList_dic.ContainsKey(groupID))
                {
                    Dictionary <string, ADR_TaskOwner> dic = new Dictionary <string, ADR_TaskOwner>(StringComparer.OrdinalIgnoreCase);
                    TaskMemberMaster.ownerList_dic[groupID] = dic;
                }

                TaskMemberMaster.ownerList_dic[groupID][ato.OwnerSID.Value] = ato;
            }
            reader.Close();
        }
Пример #2
0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(ADR_TaskOwner.Get_cmdTP());
            if (this.OwnerSID.ValueChanged)
            {
                upd.AddValue("OwnerSID", this.OwnerSID);
            }
            if (this.OwnerName.ValueChanged)
            {
                upd.AddValue("OwnerName", this.OwnerName);
            }
            if (this.Owner_LastName.ValueChanged)
            {
                upd.AddValue("Owner_LastName", this.Owner_LastName);
            }
            if (this.Owner_FirstName.ValueChanged)
            {
                upd.AddValue("Owner_FirstName", this.Owner_FirstName);
            }
            //if (this.AllProperties.ValueChanged) upd.AddValue("AllProperties", this.AllProperties);
            if (this.Telephone.ValueChanged)
            {
                upd.AddValue("Telephone", this.Telephone);
            }
            if (this.Email.ValueChanged)
            {
                upd.AddValue("Email", this.Email);
            }
            if (this.Department.ValueChanged)
            {
                upd.AddValue("Department", this.Department);
            }
            if (this.Title.ValueChanged)
            {
                upd.AddValue("Title", this.Title);
            }
            //if (this.Signature.ValueChanged) upd.AddValue("Signature", this.Signature);

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

            return(upd);
        }
Пример #3
0
        public ADR_TaskOwner GetCopy()
        {
            ADR_TaskOwner newEntity = new ADR_TaskOwner();

            if (!this.OwnerSID.IsNull_flag)
            {
                newEntity.OwnerSID.Value = this.OwnerSID.Value;
            }
            if (!this.OwnerName.IsNull_flag)
            {
                newEntity.OwnerName.Value = this.OwnerName.Value;
            }
            if (!this.Owner_LastName.IsNull_flag)
            {
                newEntity.Owner_LastName.Value = this.Owner_LastName.Value;
            }
            if (!this.Owner_FirstName.IsNull_flag)
            {
                newEntity.Owner_FirstName.Value = this.Owner_FirstName.Value;
            }
            //if (!this.AllProperties.IsNull_flag) newEntity.AllProperties.Value = this.AllProperties.Value;
            if (!this.Telephone.IsNull_flag)
            {
                newEntity.Telephone.Value = this.Telephone.Value;
            }
            if (!this.Email.IsNull_flag)
            {
                newEntity.Email.Value = this.Email.Value;
            }
            if (!this.Department.IsNull_flag)
            {
                newEntity.Department.Value = this.Department.Value;
            }
            if (!this.Title.IsNull_flag)
            {
                newEntity.Title.Value = this.Title.Value;
            }
            //if (!this.Signature.IsNull_flag) newEntity.Signature.Value = this.Signature.Value;
            return(newEntity);
        }
Пример #4
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (this.OwnerID < 0)
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(ADR_TaskOwner.Get_cmdTP());
            db_sel.tableName = "ADR_TaskOwner";
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("OwnerID", HssUtility.General.RelationalOperator.Equals, this.OwnerID);
            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);
        }
Пример #5
0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(ADR_TaskOwner.Get_cmdTP());

            dbIns.AddValue("OwnerSID", this.OwnerSID.Value);
            dbIns.AddValue("OwnerName", this.OwnerName.Value);
            dbIns.AddValue("Owner_LastName", this.Owner_LastName);   /*Optional 4*/
            dbIns.AddValue("Owner_FirstName", this.Owner_FirstName); /*Optional 5*/
            //dbIns.AddValue("AllProperties", this.AllProperties);/*Optional 6*/
            dbIns.AddValue("Telephone", this.Telephone);             /*Optional 7*/
            dbIns.AddValue("Email", this.Email);                     /*Optional 8*/
            dbIns.AddValue("Department", this.Department);           /*Optional 9*/
            dbIns.AddValue("Title", this.Title);                     /*Optional 10*/
            //dbIns.AddValue("Signature", this.Signature);/*Optional 11*/

            return(dbIns);
        }