using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using System;


//namespace SE0085.StCl
namespace FAS_LIB
{
  public class scMESUpdateFull
  {
    private int _PlantId;
    private int _AssemLineId;
    private int _OrderId;
    private int _OrderLineId;
    private int _OrdSectsId;
    private int _RoutingId;
    private string _OrdSectsCurrWorkCtr;
    private string _RoutingNextWorkCtr;
    private bool _RoutingProcessed;
    private string _hd_eto_ln;
    private string _hd_q2c_nbr;
    private string _od_ln_dsply_seq_nbr;
    private string _hd_sub_ln_itm_id;
    private string _hd_orig_shpschd_id;
    private int _hd_shp_splt;
    private int _hd_sect_id;
    private string _hd_prdn_ord_nbr;
    private string _dt_eto_workctr;
    private int _run_tm_tot;
    private DateTime _hd_disp_dt;
    private DateTime _due_st;
    private DateTime _due_fn;
    private DateTime _act_st;
    private DateTime _act_fn;
    private DateTime _od_curr_prom_dt;
    private DateTime _od_trgt_dt;
    private string _dt_prdn_dtl_status_cd;
    private DateTime _dt_update_dt;

    public int PlantId
    {
      get
      {
        return this._PlantId;
      }
      set
      {
        this._PlantId = value;
      }
    }

    public int AssemblyLineId
    {
      get
      {
        return this._AssemLineId;
      }
      set
      {
        this._AssemLineId = value;
      }
    }

    public int OrderId
    {
      get
      {
        return this._OrderId;
      }
      set
      {
        this._OrderId = value;
      }
    }

    public int OrderLineId
    {
      get
      {
        return this._OrderLineId;
      }
      set
      {
        this._OrderLineId = value;
      }
    }

    public int OrdSectsId
    {
      get
      {
        return this._OrdSectsId;
      }
      set
      {
        this._OrdSectsId = value;
      }
    }

    public int RoutingId
    {
      get
      {
        return this._RoutingId;
      }
      set
      {
        this._RoutingId = value;
      }
    }

    public string OrdSectsCurrWorkCtr
    {
      get
      {
        return this._OrdSectsCurrWorkCtr;
      }
      set
      {
        this._OrdSectsCurrWorkCtr = value;
      }
    }

    public string RoutingNextWorkCtr
    {
      get
      {
        return this._RoutingNextWorkCtr;
      }
      set
      {
        this._RoutingNextWorkCtr = value;
      }
    }

    public bool RoutingProcessed
    {
      get
      {
        return this._RoutingProcessed;
      }
      set
      {
        this._RoutingProcessed = value;
      }
    }

    public string hd_eto_ln
    {
      get
      {
        return this._hd_eto_ln;
      }
      set
      {
        this._hd_eto_ln = value;
      }
    }

    public string hd_q2c_nbr
    {
      get
      {
        return this._hd_q2c_nbr;
      }
      set
      {
        this._hd_q2c_nbr = value;
      }
    }

    public string od_ln_dsply_seq_nbr
    {
      get
      {
        return this._od_ln_dsply_seq_nbr;
      }
      set
      {
        this._od_ln_dsply_seq_nbr = value;
      }
    }

    public string hd_sub_ln_itm_id
    {
      get
      {
        return this._hd_sub_ln_itm_id;
      }
      set
      {
        this._hd_sub_ln_itm_id = value;
      }
    }

    public string hd_orig_shpschd_id
    {
      get
      {
        return this._hd_orig_shpschd_id;
      }
      set
      {
        this._hd_orig_shpschd_id = value;
      }
    }

    public int hd_shp_splt
    {
      get
      {
        return this._hd_shp_splt;
      }
      set
      {
        this._hd_shp_splt = value;
      }
    }

    public int hd_sect_id
    {
      get
      {
        return this._hd_sect_id;
      }
      set
      {
        this._hd_sect_id = value;
      }
    }

    public string hd_prdn_ord_nbr
    {
      get
      {
        return this._hd_prdn_ord_nbr;
      }
      set
      {
        this._hd_prdn_ord_nbr = value;
      }
    }

    public DateTime hd_disp_dt
    {
      get
      {
        return this._hd_disp_dt;
      }
      set
      {
        this._hd_disp_dt = value;
      }
    }

    public string dt_eto_workctr
    {
      get
      {
        return this._dt_eto_workctr;
      }
      set
      {
        this._dt_eto_workctr = value;
      }
    }

    public int run_tm_tot
    {
      get
      {
        return this._run_tm_tot;
      }
      set
      {
        this._run_tm_tot = value;
      }
    }

    public DateTime due_st
    {
      get
      {
        return this._due_st;
      }
      set
      {
        this._due_st = value;
      }
    }

    public DateTime due_fn
    {
      get
      {
        return this._due_fn;
      }
      set
      {
        this._due_fn = value;
      }
    }

    public DateTime act_st
    {
      get
      {
        return this._act_st;
      }
      set
      {
        this._act_st = value;
      }
    }

    public DateTime act_fn
    {
      get
      {
        return this._act_fn;
      }
      set
      {
        this._act_fn = value;
      }
    }

    public DateTime od_curr_prom_dt
    {
      get
      {
        return this._od_curr_prom_dt;
      }
      set
      {
        this._od_curr_prom_dt = value;
      }
    }

    public DateTime od_trgt_dt
    {
      get
      {
        return this._od_trgt_dt;
      }
      set
      {
        this._od_trgt_dt = value;
      }
    }

    public string dt_prdn_dtl_status_cd
    {
      get
      {
        return this._dt_prdn_dtl_status_cd;
      }
      set
      {
        this._dt_prdn_dtl_status_cd = value;
      }
    }

    public DateTime dt_update_dt
    {
      get
      {
        return this._dt_update_dt;
      }
      set
      {
        this._dt_update_dt = value;
      }
    }

    public string FactoryOrder
    {
      get
      {
        string str;
        if (this._hd_q2c_nbr.Length == 8 & this._od_ln_dsply_seq_nbr.Length == 3 & this._hd_sub_ln_itm_id.Length == 2 & this._hd_orig_shpschd_id.Length == 2)
        {
          try
          {
            str = Strings.Trim(this._hd_q2c_nbr) + "-" + Strings.Trim(this._od_ln_dsply_seq_nbr) + "-" + Strings.Trim(this._hd_sub_ln_itm_id) + "-" + Strings.Trim(this._hd_orig_shpschd_id);
          }
          catch (Exception ex)
          {
            ProjectData.SetProjectError(ex);
            str = "";
            ProjectData.ClearProjectError();
          }
        }
        else
          str = "";
        return str;
      }
      set
      {
        string str1 = value.Trim();
        if (str1.Length == 15)
        {
          try
          {
            string str2 = str1.Substring(0, 8);
            string str3 = str1.Substring(8, 3);
            string str4 = str1.Substring(11, 2);
            string str5 = str1.Substring(13, 2);
            this._hd_q2c_nbr = str2;
            this._od_ln_dsply_seq_nbr = str3;
            this._hd_sub_ln_itm_id = str4;
            this._hd_orig_shpschd_id = str5;
          }
          catch (Exception ex)
          {
            ProjectData.SetProjectError(ex);
            this._hd_q2c_nbr = "";
            this._od_ln_dsply_seq_nbr = "";
            this._hd_sub_ln_itm_id = "";
            this._hd_orig_shpschd_id = "";
            ProjectData.ClearProjectError();
          }
        }
      }
    }

    public string FactoryOrderOE
    {
      get
      {
        string str;
        if (this._hd_q2c_nbr.Length == 8 & this._od_ln_dsply_seq_nbr.Length == 3 & this._hd_sub_ln_itm_id.Length == 2 & this._hd_orig_shpschd_id.Length == 2)
        {
          try
          {
            str = Strings.Trim(this._hd_q2c_nbr) + "-" + Strings.Trim(this._od_ln_dsply_seq_nbr) + "-" + Strings.Trim(this._hd_sub_ln_itm_id) + "-" + Strings.Trim(this._hd_orig_shpschd_id);
          }
          catch (Exception ex)
          {
            ProjectData.SetProjectError(ex);
            str = "";
            ProjectData.ClearProjectError();
          }
        }
        else
          str = "";
        return str;
      }
      set
      {
        string str1 = !value.Trim().StartsWith("085-") ? value.Trim() : value.Trim().Remove(0, 4);
        char[] charArray = str1.ToCharArray();
        if (charArray.Length >= 18)
        {
          if (Operators.CompareString(Conversions.ToString(charArray[8]), "-", false) == 0 & Operators.CompareString(Conversions.ToString(charArray[12]), "-", false) == 0 & Operators.CompareString(Conversions.ToString(charArray[15]), "-", false) == 0)
          {
            try
            {
              string str2 = str1.Substring(0, 8);
              string str3 = str1.Substring(9, 3);
              string str4 = str1.Substring(13, 2);
              string str5 = str1.Substring(16, 2);
              this._hd_q2c_nbr = str2;
              this._od_ln_dsply_seq_nbr = str3;
              this._hd_sub_ln_itm_id = str4;
              this._hd_orig_shpschd_id = str5;
            }
            catch (Exception ex)
            {
              ProjectData.SetProjectError(ex);
              this._hd_q2c_nbr = "";
              this._od_ln_dsply_seq_nbr = "";
              this._hd_sub_ln_itm_id = "";
              this._hd_orig_shpschd_id = "";
              ProjectData.ClearProjectError();
            }
          }
        }
      }
    }

    public string FOLineSLSS
    {
      get
      {
        return this._hd_q2c_nbr + this._od_ln_dsply_seq_nbr + this._hd_sub_ln_itm_id + this._hd_orig_shpschd_id;
      }
      set
      {
        string str1 = value.Trim();
        if (str1.Length == 15)
        {
          try
          {
            string str2 = str1.Substring(0, 8);
            string str3 = str1.Substring(8, 3);
            string str4 = str1.Substring(11, 2);
            string str5 = str1.Substring(13, 2);
            this._hd_q2c_nbr = str2;
            this._od_ln_dsply_seq_nbr = str3;
            this._hd_sub_ln_itm_id = str4;
            this._hd_orig_shpschd_id = str5;
          }
          catch (Exception ex)
          {
            ProjectData.SetProjectError(ex);
            this._hd_q2c_nbr = "";
            this._od_ln_dsply_seq_nbr = "";
            this._hd_sub_ln_itm_id = "";
            this._hd_orig_shpschd_id = "";
            ProjectData.ClearProjectError();
          }
        }
      }
    }

    public bool FOFormatValid
    {
      get
      {
        bool flag;
        try
        {
          int num = 0;
          if (this.FOLineSLSS.Length == 15)
          {
            char[] charArray = this.FOLineSLSS.ToCharArray();
            int index = 0;
            while (index < charArray.Length)
            {
              char String = charArray[index];
              checked { ++num; }
              if (num >= 9 & num <= 11)
              {
                if (!(48 <= Strings.Asc(String) & Strings.Asc(String) <= 57 | 65 <= Strings.Asc(String) & Strings.Asc(String) <= 90 | 97 <= Strings.Asc(String) & Strings.Asc(String) <= 122))
                {
                  flag = false;
                  goto label_13;
                }
              }
              else if (!(48 <= Strings.Asc(String) & Strings.Asc(String) <= 57))
              {
                flag = false;
                goto label_13;
              }
              checked { ++index; }
            }
          }
          else
          {
            flag = false;
            goto label_13;
          }
        }
        catch (Exception ex)
        {
          ProjectData.SetProjectError(ex);
          flag = false;
          ProjectData.ClearProjectError();
          goto label_13;
        }
        flag = true;
label_13:
        return flag;
      }
    }

    public scMESUpdateFull()
    {
      this._PlantId = 1;
      this._AssemLineId = 0;
      this._OrderId = 0;
      this._OrderLineId = 0;
      this._OrdSectsId = 0;
      this._RoutingId = 0;
      this._OrdSectsCurrWorkCtr = "";
      this._RoutingNextWorkCtr = "";
      this._RoutingProcessed = false;
      this._hd_eto_ln = "";
      this._hd_q2c_nbr = "";
      this._od_ln_dsply_seq_nbr = "";
      this._hd_sub_ln_itm_id = "00";
      this._hd_orig_shpschd_id = "01";
      this._hd_shp_splt = 0;
      this._hd_sect_id = 0;
      this._hd_prdn_ord_nbr = "";
      this._hd_disp_dt = Conversions.ToDate("01/01/1900");
      this._dt_eto_workctr = "";
      this._run_tm_tot = 0;
      this._due_st = Conversions.ToDate("01/01/1900");
      this._due_fn = Conversions.ToDate("01/01/1900");
      this._act_st = Conversions.ToDate("01/01/1900");
      this._act_fn = Conversions.ToDate("01/01/1900");
      this._od_curr_prom_dt = Conversions.ToDate("01/01/1900");
      this._od_trgt_dt = Conversions.ToDate("01/01/1900");
      this._dt_prdn_dtl_status_cd = "";
      this._dt_update_dt = Conversions.ToDate("01/01/1900");
    }

    public override string ToString()
    {
      return this._hd_q2c_nbr + this._od_ln_dsply_seq_nbr + this._hd_sub_ln_itm_id + this._hd_orig_shpschd_id;
    }
  }
}
