Exemplo n.º 1
0
        public static string GetUserNameByProjectCode(string ProjectCode, string UserName, string UserShortName, EntityData ProjectData)
        {
            string text3;

            try
            {
                string text = "";
                bool   flag = false;
                if (ProjectData != null)
                {
                    foreach (DataRow row in ProjectData.CurrentTable.Select())
                    {
                        if (row["ProjectCode"].ToString() == ProjectCode)
                        {
                            flag = ProjectRule.IsUseShortNameByValue(row["IsUseShortName"].ToString());
                        }
                    }
                }
                else
                {
                    flag = ProjectRule.IsUseShortNameByProjectCode(ProjectCode);
                }
                if (flag)
                {
                    text = UserShortName;
                    switch (text)
                    {
                    case null:
                    case "":
                        text = UserName;
                        break;
                    }
                }
                else
                {
                    text = UserName;
                }
                text3 = text;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text3);
        }