Beispiel #1
0
 internal void AddOneProcess(TreeNode subNode)
 {
     if (subNode.Tag is DELProcessClass)
     {
         DELProcessClass tag = (DELProcessClass)subNode.Tag;
         this.lvwNavigater.Items.Add(tag.Name, subNode.ImageIndex).Tag = subNode;
     }
     else
     {
         DELProcessDefProperty property = (DELProcessDefProperty)subNode.Tag;
         PLUser       user  = new PLUser();
         ListViewItem item2 = this.lvwNavigater.Items.Add(subNode.Text, subNode.ImageIndex);
         try
         {
             item2.SubItems.Add(user.GetUserByOid(property.CreatorID).Name);
         }
         catch (Exception)
         {
             item2.SubItems.Add("");
         }
         item2.SubItems.Add(property.CreationDate.ToString("yyyy-MM-dd HH:mm:ss"));
         item2.SubItems.Add(property.UpdateDate.ToString("yyyy-MM-dd HH:mm:ss"));
         item2.SubItems.Add(property.Duration.ToString() + property.DurationUnit);
         item2.SubItems.Add(property.Description);
         item2.Tag = subNode;
     }
 }
Beispiel #2
0
 private static void LogOff()
 {
     try {
         PLUser.Logoff(ClientData.LogonUser.Oid, PLMProductName.TiModeler.ToString(), ClientData.Session);
         UIMessage.Instance.UninitilizeMessage();
         BizOperationHelper.ClearLocalTempFiles();
     } catch {
     }
 }
Beispiel #3
0
        private void DisplayUsers()
        {
            this.lvwUser.Items.Clear();
            List <string> list = new List <string>();

            switch (this.viewMode)
            {
            case UserViewMode.ByOrgTree:
                this.tvwOrg.Visible = true;
                OrgModelUL.FillOrgTree(this.tvwOrg.Nodes[0], ClientData.MyImageList.GetIconIndex("ICO_RSP_ORG"));
                this.tvwOrg.Nodes[0].Expand();
                this.tvwOrg.AfterSelect += this.selectOrg;
                break;

            case UserViewMode.ByList: {
                this.tvwOrg.Visible      = false;
                this.tvwOrg.AfterSelect -= this.selectOrg;
                ArrayList allUsers = null;
                try {
                    PLUser user = new PLUser();
                    allUsers = user.GetAllUsers();
                    if (this.showSysAdmin)
                    {
                        string sysAdmin = user.GetSysAdmin();
                        DEUser byLogId  = user.GetByLogId(sysAdmin);
                        allUsers.Add(byLogId);
                    }
                } catch (Exception exception) {
                    PrintException.Print(exception);
                    return;
                }
                if (allUsers != null)
                {
                    foreach (DEUser user3 in allUsers)
                    {
                        ListViewItem item = this.lvwUser.Items.Add(user3.LogId, ClientData.MyImageList.GetIconIndex("ICO_RSP_USER"));
                        item.SubItems.Add(user3.Name);
                        item.Tag = user3;
                        if (!list.Contains(user3.Name))
                        {
                            list.Add(user3.Name);
                        }
                        if (!list.Contains(user3.LogId))
                        {
                            list.Add(user3.LogId);
                        }
                    }
                }
                OrgModelUL.ChangeFrozenIco(this.lvwUser);
                break;
            }
            }
            this.txtUser.AutoCompleteCustomSource.Clear();
            this.txtUser.AutoCompleteCustomSource.AddRange(list.ToArray());
        }
Beispiel #4
0
        private void InitDisplayWhenCreateItem()
        {
            base.Height = 0x70;
            this.pnlSecurity.Visible = true;
            base.Height += 0x60;
            PLUser user = new PLUser();
            int    userSecurityByOid = user.GetUserSecurityByOid(ClientData.LogonUser.Oid);

            this.cobGroup.Properties.Items.Clear();
            this.cobGroup.Text = "";
            object[] items = new object[userSecurityByOid];
            for (int i = 1; i <= userSecurityByOid; i++)
            {
                items[i - 1] = i.ToString();
            }
            this.cobSecurityLevel.Properties.Items.AddRange(items);
            int securityLevel = ModelContext.MetaModel.GetClass(this.className).SecurityLevel;

            if ((securityLevel >= 1) && (securityLevel <= userSecurityByOid))
            {
                this.cobSecurityLevel.SelectedIndex = securityLevel - 1;
            }
            else if ((userSecurityByOid >= 1) && (userSecurityByOid <= securityLevel))
            {
                this.cobSecurityLevel.SelectedIndex = userSecurityByOid - 1;
            }
            else
            {
                this.cobSecurityLevel.SelectedIndex = -1;
            }
            ArrayList belongingProjGroupByUserOid = user.GetBelongingProjGroupByUserOid(ClientData.LogonUser.Oid);

            this.cobGroup.Properties.Items.Add("");
            if ((belongingProjGroupByUserOid != null) && (belongingProjGroupByUserOid.Count > 0))
            {
                this.cobGroup.Properties.Items.AddRange(belongingProjGroupByUserOid.ToArray());
            }
            else
            {
                this.cobGroup.Enabled = false;
            }
            ArrayList parentOrgs = user.GetParentOrgs(ClientData.LogonUser.Oid);

            foreach (DEOrganization organization in parentOrgs)
            {
                this.cobOrgs.Properties.Items.Add(organization.Name);
            }
            this.cobOrgs.Tag      = parentOrgs;
            this.cobOrgs.Text     = "未指定";
            this.txtRevLabel.Text = "1";
        }
Beispiel #5
0
        private DEUser GetUserById(Guid userOid)
        {
            PLUser user = new PLUser();

            if (this.htUsers.Contains(userOid))
            {
                return((DEUser)this.htUsers[userOid]);
            }
            DEUser userByOid = user.GetUserByOid(userOid);

            if (userByOid != null)
            {
                this.htUsers[userOid] = userByOid;
                return(userByOid);
            }
            return(null);
        }
        }//end method

        private void addPhoneCalls()
        {
            int      nPhone = 0;
            DateTime DateStart;
            DateTime DateEnd;
            TimeSpan Duration;
            //int nDateStart = 0;
            int nStartTime = 0;
            int nEndTime   = 0;
            int nValue     = 0;

            DataTable Table   = new DataTable("Phone");
            string    sSelect = "SELECT * FROM [PhoneCall]";

            ReadAMTable(ref Table, sSelect);

            for (nPhone = 0; nPhone < Table.Rows.Count; nPhone++)
            {
                PCLaw.Diary.EntryType        = PLConvert.PLDiary.eType.Call;
                PCLaw.Diary.CallDirectionOut = bool.Parse(Table.Rows[nPhone]["OutgoingCall"].ToString().Trim());

                PCLaw.Diary.CallContactName = Table.Rows[nPhone]["CallerName"].ToString().Trim();
                PCLaw.Diary.CallPhoneNumber = Table.Rows[nPhone]["CallerNumber"].ToString().Trim();

                int nDate = int.Parse(Table.Rows[nPhone]["DueDate"].ToString().Trim()); //see appointment for same code with notes
                if (nDate < 19820101)
                {
                    nDate = 19820101;
                }
                DateStart           = Convert.ToDateTime(Table.Rows[nPhone]["StartTime"].ToString());
                PCLaw.Diary.DueDate = nDate;

                PCLaw.Diary.EnteredDate = int.Parse(Table.Rows[nPhone]["EnteredDate"].ToString().Trim());

                nStartTime            = DateStart.Hour * 100 + DateStart.Minute; //see appointment for same code with notes hhmm
                PCLaw.Diary.StartTime = nStartTime;

                if (!string.IsNullOrEmpty(Table.Rows[nPhone]["EndTime"].ToString())) //shouldnt ever be null or empty
                {
                    if (int.Parse(Table.Rows[nPhone]["EndTime"].ToString()) != 0)    //should be zero if we are using duration (like for splits)
                    {
                        DateEnd  = Convert.ToDateTime(Table.Rows[nPhone]["EndTime"].ToString());
                        nEndTime = DateEnd.Hour * 100 + DateEnd.Minute;

                        Duration = DateEnd - DateStart;

                        PCLaw.Diary.Duration = Duration.Days * 24 + Duration.Hours + Duration.Minutes / 60; //see appointment for same code with notes
                    }
                }

                else
                {
                    PCLaw.Diary.Duration = double.Parse(Table.Rows[nPhone]["Duration"].ToString());
                }


                if (PCLaw.Diary.Duration < 0)
                {
                    PCLaw.Diary.Duration = 1.0 / 60.0; //one minute
                }
                if (!string.IsNullOrEmpty(Table.Rows[nPhone]["Description"].ToString().Trim()))
                {
                    PCLaw.Diary.Description = Table.Rows[nPhone]["Description"].ToString().Trim();
                }
                else
                {
                    PCLaw.Diary.Description = "Converted Call - No Description available";
                }

                switch (Convert.ToInt32(Table.Rows[nPhone]["CallActionTaken"].ToString().Trim()))
                {
                // 1 = spoke, 2 = Left Message, 3 = No Answer, 4 = Busy, 5 = Voice Mail
                case 1:
                    PCLaw.Diary.PhoneCallAction = PLConvert.PLDiary.eCallAction.Spoke;
                    break;

                case 2:
                    PCLaw.Diary.PhoneCallAction = PLConvert.PLDiary.eCallAction.LeftMsg;
                    break;

                case 3:
                    PCLaw.Diary.PhoneCallAction = PLConvert.PLDiary.eCallAction.NoAnswer;
                    break;

                case 4:
                    PCLaw.Diary.PhoneCallAction = PLConvert.PLDiary.eCallAction.Busy;
                    break;

                case 5:
                    PCLaw.Diary.PhoneCallAction = PLConvert.PLDiary.eCallAction.VoiceMail;
                    break;
                }//end switch

                //did they call them back?
                if (!string.IsNullOrEmpty(Table.Rows[nPhone]["PhoneCallReturned"].ToString().Trim()))
                {
                    PCLaw.Diary.PhoneCallReturnedCall = bool.Parse(Table.Rows[nPhone]["PhoneCallReturned"].ToString().Trim());
                }
                else
                {
                    PCLaw.Diary.PhoneCallReturnedCall = false;
                }

                if (!string.IsNullOrEmpty(Table.Rows[nPhone]["IsUrgent"].ToString().Trim()))
                {
                    if (bool.Parse(Table.Rows[nPhone]["IsUrgent"].ToString().Trim()))
                    {
                        PCLaw.Diary.Priority = PLConvert.PLDiary.ePriority.High;
                    }
                    else
                    {
                        PCLaw.Diary.Priority = PLConvert.PLDiary.ePriority.Normal;
                    }
                }//end if
                else
                {
                    PCLaw.Diary.Priority = PLConvert.PLDiary.ePriority.Normal;
                }

                if (bool.Parse(Table.Rows[nPhone]["Completed"].ToString().Trim()))
                {
                    PCLaw.Diary.Completed      = true;
                    PCLaw.Diary.CompletionDate = int.Parse(Table.Rows[nPhone]["CompletedDate"].ToString().Trim());
                }
                else
                {
                    PCLaw.Diary.Completed = false;
                }

                PCLaw.Diary.MatterID = PLMatter.GetIDFromExtID1(Table.Rows[nPhone]["MatterID"].ToString().Trim());
                if (PCLaw.Diary.MatterID == 0) //not found and is required....diary entry not added
                {
                    PCLaw.Diary.Clear();
                    continue;
                }//end if

                //add users to diary entry
                string[] users         = Table.Rows[nPhone]["UserID"].ToString().Split('|');
                bool     isMessageRead = true;
                bool     hasUser       = false;
                foreach (string user in users)
                {
                    nValue = PLUser.GetIDFromNN(user.Trim());
                    if (nValue != 0)
                    {
                        PCLaw.Diary.AddUser(nValue, isMessageRead);
                        hasUser = true;
                    } //end if
                }     //end foreach

                //add contacts to diary entry
                string[] contacts = Table.Rows[nPhone]["ContactID"].ToString().Split('|');
                foreach (string contact in contacts)
                {
                    nValue = PLContact.GetIDFromExtID1(contact.Trim());
                    if (nValue != 0)
                    {
                        PCLaw.Diary.AddContact(nValue);
                    }
                }//end foreach


                if (!hasUser)//at least one user is required so if we have none, assign it to ADMIN
                {
                    nValue = PLUser.GetIDFromNN("ADMIN");
                    PCLaw.Diary.AddUser(nValue, isMessageRead);
                }//end if

                PCLaw.Diary.AddRecord();
            } //end for
            PCLaw.Diary.SendLast();
        }     //end method
Beispiel #7
0
        public DlgNewGuid(string templateType, DEUser user)
        {
            this.InitializeComponent();
            this.tvHeadItem = new UCSelectClass(false, SelectClassConstraint.BusinessItemClass);
            this.pnlHeadItem.Controls.Add(this.tvHeadItem);
            this.tvHeadItem.Dock = DockStyle.Fill;
            this.tvMainItem      = new UCSelectClass(false, SelectClassConstraint.BusinessItemClass);
            this.pnlMainItem.Controls.Add(this.tvMainItem);
            this.tvMainItem.Dock = DockStyle.Fill;
            this.tmpType         = templateType;
            try {
                this.m_tp          = new CLCardTemplate(user.Oid, true, false, null);
                this.m_tp.UserName = user.Name;
            } catch (Exception exception) {
                throw new Exception("新建CLCardTemplate失败。", exception);
            }
            PLUser user2             = new PLUser();
            int    userSecurityByOid = user2.GetUserSecurityByOid(ClientData.LogonUser.Oid);

            if (userSecurityByOid == 0)
            {
                userSecurityByOid = 1;
            }
            this.cobGroup.Items.Clear();
            for (int i = 1; i <= userSecurityByOid; i++)
            {
                this.cobGroup.Items.Add(i);
            }
            this.cobGroup.Enabled = true;
            ArrayList belongingProjGroupByUserOid = user2.GetBelongingProjGroupByUserOid(ClientData.LogonUser.Oid);

            if ((belongingProjGroupByUserOid != null) && (belongingProjGroupByUserOid.Count > 0))
            {
                this.cobGroup.DataSource    = belongingProjGroupByUserOid;
                this.cobGroup.DisplayMember = "Name";
                this.cobGroup.ValueMember   = "Oid";
            }
            else
            {
                this.cobGroup.Enabled = false;
            }
            string clsname         = "PPCRDTEMPLATE";
            bool   isGenIdInServer = false;

            this.txtId.Text = PLItem.GetIDAtNew(clsname, out isGenIdInServer);
            this.txtId.Tag  = isGenIdInServer;
            if (isGenIdInServer)
            {
                this.txtId.Text = "自动生成";
            }
            if (!string.IsNullOrEmpty(this.txtId.Text))
            {
                this.txtId.ReadOnly  = true;
                this.btnCode.Enabled = false;
            }
            else
            {
                this.txtId.ReadOnly  = false;
                this.btnCode.Enabled = true;
            }
            this.SetTreeViewState(templateType);
        }