예제 #1
0
        public FileImportForm(bool startOnList, int mode, int type)
        {
            m_pictureManager = PictureManager.This;
            m_mode = mode;
            m_type = type;

            m_statusTab	= new StatusTab(this);
            m_formatTab	= new FormatTab(this);
            m_fileTab	= new FileTab(this);
            m_importTab = new ImportTab(this);
            m_finishTab = new FinishTab(this);

            // Required for Windows Form Designer support
            InitializeComponent();

            //tabControl1.FlatStyle = FlatStyle.Flat;

            setLockedFeatures();

            detailComboBox.Items.Clear();
            detailComboBox.Text = "";

            previousButton.Enabled = false;
            nextButton.Enabled = true;
            doPersist = false;

            m_statusTab.tabActivated();		// make sure the list of current imports appears there, in case the Back button is clicked
            m_tab = startOnList ? 0 : 1;
            this.tabControl1.SelectedIndex = m_tab;
            m_formatTab.tabActivated();

            /*
             * how do we make tabs not clickable?
            tabControl1.
            fileTabPage.CanSelect = false;
            importTabPage.CanSelect = false;
            resultsTabPage.CanSelect = false;
            */

            Project.setDlgIcon(this);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            RequestUrlAuthority = (string)Request.Url.Authority;
            //Remoto
            Thread.CurrentThread.CurrentCulture   = CultureInfo.CreateSpecificCulture("en-US");
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
            //Local
            //Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("es-CO");
            //Thread.CurrentThread.CurrentUICulture = new CultureInfo("es-CO");
            base.InitializeCulture();

            if (!IsPostBack)
            {
                HttpContext.Current.Session["TABLA"] = "";
                HttpContext.Current.Session["PAID"]  = "";
                HttpContext.Current.Session["ORNO"]  = "";
                HttpContext.Current.Session["CLOT"]  = "";
                HttpContext.Current.Session["CWAR"]  = "";
                HttpContext.Current.Session["LOCA"]  = "";
                HttpContext.Current.Session["QTYA"]  = "";

                formName = Request.Url.AbsoluteUri.Split('/').Last();

                if (formName.Contains('?'))
                {
                    formName = formName.Split('?')[0];
                }
                Label control = (Label)Page.Controls[0].FindControl("lblPageTitle");
                if (Session["user"] == null)
                {
                    Response.Redirect(ConfigurationManager.AppSettings["UrlBase"] + "/WebPages/Login/whLogIni.aspx");
                }

                _operator = Session["user"].ToString();

                try
                {
                    _idioma = Session["ddlIdioma"].ToString();
                }
                catch (Exception)
                {
                    _idioma = "INGLES";
                }

                string strError = string.Empty;
                resultado = ITticol137.List_StatusPallet_OriginTable(ref strError);
                if (resultado.Rows.Count > 0)
                {
                    LstStatusTab = new List <StatusTab>();
                    foreach (DataRow reg in resultado.Rows)
                    {
                        StatusTab objStaTab = new StatusTab();
                        objStaTab.Table = reg["TAB"].ToString();
                        objStaTab.Code  = reg["CODE"].ToString();
                        objStaTab.Desc  = reg["DESCR"].ToString();
                        LstStatusTab.Add(objStaTab);
                    }
                }
                string strTitulo = mensajes("encabezado");
                control.Text = strTitulo;
                Ent_ttccol301 data = new Ent_ttccol301()
                {
                    user    = HttpContext.Current.Session["user"].ToString(),
                    come    = strTitulo,
                    refcntd = 0,
                    refcntu = 0
                };

                List <Ent_ttccol301> datalog = new List <Ent_ttccol301>();
                datalog.Add(data);

                _idalttccol301.insertarRegistro(ref datalog, ref strError);
            }
        }