Example #1
0
        public string Getddlkhet()
        {
            HttpContext context = HttpContext.Current;

            if (context.Session["USER"] != null)
            {
                Hashtable userDetail = new Hashtable();
                userDetail = (Hashtable)context.Session["USER"];
                user       = new WebManageUserData(userDetail);
                Cs_initaldata inl = new Cs_initaldata(user);

                string options = string.Empty;

                options += "<option value=' '>กรุณาเลือก</option></br>";

                DataTable dt = inl.GetDatabySQL(" SELECT id , name FROM districts ORDER BY id ", user.UserCons);

                foreach (DataRow row in dt.Rows)
                {
                    string code = row[Cs_initaldata.Feild.ID.ToString()].ToString();
                    string name = row[Cs_initaldata.Feild.NAME.ToString()].ToString();

                    options += "<option value='" + code + "'>" + name + "</option></br>";
                }

                var keyValues = new Dictionary <string, string>
                {
                    { "option", options }
                };
                return(JsonConvert.SerializeObject(keyValues));
            }
            return(JsonConvert.SerializeObject(new { redirec = new Cs_manageLoing().GetLoginPage() }));
        }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["USER"] != null)
     {
         Hashtable        userDetail = new Hashtable(); userDetail = (Hashtable)Session["USER"]; user = new WebManageUserData(userDetail);
         Cs_Controlcenter cs         = new Cs_Controlcenter(); unit_percent = cs.unit_percent();
     }
     else
     {
         Response.Redirect(new Cs_manageLoing().GetLoginPage());
     }
 }
Example #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["USER"] != null)
     {
         Hashtable userDetail = new Hashtable(); userDetail = (Hashtable)Session["USER"]; user = new WebManageUserData(userDetail);
         txtUsername.InnerText = user.UserNAME.ToString();
     }
     else
     {
         Response.Redirect(new Cs_manageLoing().GetLoginPage());
     }
 }
Example #4
0
 public api(WebManageUserData user)
 {
     this.user = user;
 }