Пример #1
0
        public static string lfFillDropOffice(string idcompany, string idperson)
        {
            string shead = string.Empty, sbody = string.Empty;
            string ssubhead      = "<ul class='dropdown-menu' role='menu' aria-labelledby='menu1'>";
            string ssubheadffoot = "</ul>";

            DataTable dtOffices = ControlsBLL.GetOffices(Convert.ToInt32(idcompany), Convert.ToInt32(idperson)).Copy();

            if (dtOffices.Rows.Count > 0)
            {
                for (int i = 0; i < dtOffices.Rows.Count; i++)
                {
                    if (i == 0)
                    {
                        shead = "<button iddropofficeselect='" + dtOffices.Rows[i][0].ToString() + "' class='btn btn-default dropdown- toggle' type='button' id='dropoffice' data-toggle='dropdown'> " + dtOffices.Rows[i][1].ToString() + " <span class='caret'></span> </button>";
                    }

                    sbody += " <li role='presentation'><a iddrop='" + dtOffices.Rows[i][0].ToString() + "' onclick='lfOfficeSetValue(this);' role='menuitem' tabindex='-1' href='#'>" + dtOffices.Rows[i][1].ToString() + "</a></li>";
                }

                HttpContext.Current.Session["Office"]  = dtOffices.Rows[0][0];
                HttpContext.Current.Session["Company"] = idcompany;
                return(string.Concat(shead + ssubhead + sbody + ssubheadffoot));
            }
            return(string.Empty);
        }
Пример #2
0
        public static string User_Validation(int user, string pwd, int company, int office)
        {
            string sResponse = string.Empty;

            try
            {
                sResponse = ControlsBLL.gfUserCheckExist(user, pwd, company, office).Rows[0][0].ToString();
                string[] asResponse = sResponse.Split('|');
                if (asResponse[0] == "1")
                {
                    sResponse = ICompanyController.gfCompaniaPathImg(company, asResponse[1]);
                    HttpContext.Current.Session["sImgEmpresa"] = sResponse;
                    HttpContext.Current.Session["Person"]      = user;
                    HttpContext.Current.Session["Company"]     = company;
                    HttpContext.Current.Session["Office"]      = office;

                    SqlConnectionStringBuilder sDataBase = new SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings["INTEGRAPRODUCCIONI"].ToString());
                    HttpContext.Current.Session["sDataBase"] = sDataBase["Database"].ToString();

                    return("200");
                }
                else
                {
                    return("404");
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                return("404");
            }
        }
Пример #3
0
 public static void gfSalirdelSistema()
 {
     try
     {
         int user    = int.Parse(HttpContext.Current.Session["Person"].ToString());
         int company = int.Parse(HttpContext.Current.Session["Company"].ToString());
         int office  = int.Parse(HttpContext.Current.Session["Office"].ToString());
         ControlsBLL.gfUserCheckOut(user, "", company, office);
         //Console.Write(HttpContext.Current.Session.Count.ToString());
         HttpContext.Current.Session.Clear();
         HttpContext.Current.Response.Redirect("~/Default.aspx");
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }
Пример #4
0
 private void ObtenerDatosEmpresa()
 {
     if (Session["Company"].ToString() != "")
     {
         DataTable dt = new DataTable();
         dt = ControlsBLL.ObtenDatosEmpresa(Convert.ToInt32(Session["Company"]));
         if (dt.Rows.Count > 0)
         {
             lblEmpresa.Text = Convert.ToString(dt.Rows[0][0]);
             Page.Title      = Convert.ToString(dt.Rows[0][0]).ToString().ToUpper();
         }
         else
         {
             lblEmpresa.Text = "Sin Empresa";
         }
         lnkCerrarSesion.Visible = true;
         lblUsuario.Text         = Session["NamePerson"].ToString();
     }
 }