예제 #1
0
 public EPortSend(EPortSend send, int what, char electric)
     : this()
 {
     key           = send.key;
     kind          = send.kind;
     date          = send.date;
     ucn           = send.ucn;
     ucnType       = send.ucnType;
     involvement   = send.involvement;
     eventStatus   = send.eventStatus;
     subpoenaNo    = send.subpoenaNo;
     this.what     = what;
     this.electric = electric;
 }
예제 #2
0
    public static void DeleteConflictingGuid(Connection conn, Guid guid)
    {
        SqlSelect select = new SqlSelect(EPortGuidName, CommonFields);

        select.AddString("F_GUID", guid.ToString());

        using (Query q = new Query(conn, select))
        {
            if (q.Read())
            {
                EPortSend send = new EPortSend();

                send.GetData(q, CommonFields);
                send.DeleteGuid(conn, guid, " conflicting");
            }
        }
    }
예제 #3
0
    private static string ElectricName(EPortSend send, char kind, int iDate, char electric)
    {
        int    electricIndex = Convert.ToInt32(electric.ToString());
        string dir           = Const.ElectricDirs[electricIndex];

        if (dir == "")
        {
            return(null);
        }

        DateTime      date = IntDate.ToDate(iDate);
        StringBuilder name = new StringBuilder();

        if (send.what / What.Factor == What.MotiveHigh)
        {
            kind = Kind.Motives;
        }

        name.AppendFormat("{0}\\{1:D2}{2:X2}{3:X2}{4:D2}\\", dir, send.key.no / (send.key.no <= 99999 ? 1000 : 10000),
                          (int)send.key.type, CP1251.IndexOf(kind), send.key.year % 100);

        if (send.key.no <= 99999)
        {
            name.AppendFormat("{0:D3}", send.key.no % 1000);
        }
        else
        {
            int modNo = send.key.no % 10000;

            name.AppendFormat("{0}{1}{2}", 'a' + modNo / 22 / 22, 'a' + (modNo / 22) % 22, 'a' + modNo % 22);
        }

        name.AppendFormat("{0:X1}{1:D2}{2:D2}", date.Month, date.Day, date.Year % 100);

        if (send.subpoenaNo > 0)
        {
            name.AppendFormat("{0:X4}", send.subpoenaNo);
        }

        name.AppendFormat(".{0}", Const.ElectricExts[electricIndex]);
        return(name.ToString());
    }
예제 #4
0
    public static string Name(EPortSend send, char kind, int date, char electric)
    {
        string name = ElectricName(send, kind, date, electric);

        return(name != null?ShortenName(name) : null);
    }