Ignore:
Timestamp:
Aug 30, 2010, 2:51:30 PM (14 years ago)
Author:
Sam Habiel
Message:

Changes in handling of Divisions. Now prompts if more than one division assigned to user.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BMXNET_RPMS_dotNET_UTILITIES-BMX/trunk/cs/bmx_0200scr/BMX2/BMXNet/BMXNetConnectInfo.cs

    r822 r923  
    972972                                m_nDivisionCount = rsDivisions.Rows.Count;
    973973
    974                                 //The MOST_RECENT_LOOKUP field contains DUZ(2)
    975                                 foreach (System.Data.DataRow r in rsDivisions.Rows)
    976                                 {
    977                                         string sTemp = r["MOST_RECENT_LOOKUP"].ToString();
    978                                         if ((sTemp == "1") || (rsDivisions.Rows.Count == 1))
    979                                         {
    980                                                 this.m_sDivision = r["FACILITY_NAME"].ToString();
    981                                                 this.m_sDUZ2 = r["FACILITY_IEN"].ToString();
    982                                                 break;
    983                                         }
    984                                 }
     974                // Must have at least one division in order for our code to work
     975                // If user has no divisions, M routine will invent one for our sake (get it from kernel).
     976                //
     977                Debug.Assert(m_nDivisionCount > 0, "Must get at least one division from VISTA");
     978
     979                // if more than one division, have user pick
     980                // if just one, get the DUZ(2) and then set it via the property DUZ2.
     981               
     982                if (m_nDivisionCount > 1)
     983                {
     984                    ChangeDivision(null);
     985                    // following true if user cancelled.
     986                    if (DUZ2 == null) throw new BMXNetException("No division chosen -- can't log in");
     987                }
     988                // if just one
     989                else DUZ2 = m_sDUZ2 = rsDivisions.Rows[0]["FACILITY_IEN"].ToString();
     990               
    985991                        }
    986992                        catch(Exception bmxEx)
     
    10111017                {
    10121018                        DSelectDivision dsd = new DSelectDivision();
    1013                         dsd.InitializePage(UserDivisions, DUZ2);
     1019                        dsd.InitializePage(UserDivisions);
    10141020
    10151021                        if (dsd.ShowDialog(frmCaller) == DialogResult.Cancel)
Note: See TracChangeset for help on using the changeset viewer.