Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     moduleid      = Request.QueryString["moduleid"];
     groupid       = Request.QueryString["grpid"];
     dbtimeout     = int.Parse(ConfigurationSettings.AppSettings["dbTimeOut"]);
     ConnString    = Session["ConnStringLogin"].ToString();
     ModConnString = MNTTools.GetConnString(moduleid);
     if (!IsPostBack)
     {
         using (modconn = new DbConnection(ModConnString))
         {
             //ViewData();
         }
     }
     else
     {
         if (Request.Form["sta"] == "save")
         {
             using (modconn = new DbConnection(ModConnString))
             {
                 SaveData();
             }
         }
     }
 }
Example #2
0
 protected override void OnLoad(EventArgs e)
 {
     moduleid      = Request.QueryString["moduleid"];
     groupid       = Request.QueryString["gid"];
     dbtimeout     = int.Parse(ConfigurationSettings.AppSettings["dbTimeOut"]);
     ModConnString = MNTTools.GetConnString(moduleid);
     modconn       = new DbConnection(ModConnString);
     base.OnLoad(e);
 }
        private void InitializeModule(bool init)
        {
            try
            {
                RBL_MODULE.Items.Clear();

                string cond = " where groupid = '" + DDL_GROUPID.SelectedValue +
                              "' and moduleid in (" + MaintainedModuleIDs + ") ";
                conn.ExecReader(Q_MODULEGROUP + cond, null, dbtimeout);
                int i = 0;
                while (conn.hasRow())
                {
                    string moduleid = conn.GetFieldValue("moduleid").Trim();
                    string src      = conn.GetFieldValue("usermntpage").Trim();
                    RBL_MODULE.Items.Add(new ListItem(conn.GetFieldValue("modulename"), moduleid));
                    if (i == 0 && src != "")
                    {
                        if (src.IndexOf("?") > 0)
                        {
                            src += "&";
                        }
                        else
                        {
                            src += "?";
                        }
                        src += "moduleid=" + moduleid + "&moddesc=" + RBL_MODULE.Items[0].Text + "&grpid=" + DDL_GROUPID.SelectedValue + "&uid=" + TXT_USERID.Text + "&spv=" + uREF_UPLINER.SelectedValue;
                        IFR_MODULE.Attributes.Remove("src");
                        IFR_MODULE.Attributes.Add("src", src);
                        RBL_MODULE.SelectedIndex = 0;
                        i++;
                    }
                    if (init)
                    {
                        try
                        {
                            using (DbConnection modconn = new DbConnection(MNTTools.GetConnString(moduleid)))
                            {
                                object[] pardata = new object[2] {
                                    TXT_USERID.Text, moduleid
                                };
                                modconn.ExecuteNonQuery(SP_INITPENDINGMODULEUSER, pardata, dbtimeout);
                            }
                        }
                        catch (Exception ex1)
                        {
                            Response.Write("<!-- " + ex1.Message.Replace("-->", "--)") + " -->\n");
                            MNTTools.LogError(this, (string)Session["UserID"], ex1);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write("<!-- " + ex.Message.Replace("-->", "--)") + " -->\n");
                MNTTools.LogError(this, (string)Session["UserID"], ex);
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            string modid = "61";

            if (Request.QueryString["moduleid"] != null && Request.QueryString["moduleid"].Trim() != "")
            {
                modid = Request.QueryString["moduleid"];
            }
            conn = new DbConnection(MNTTools.GetConnString(modid));
            base.OnLoad(e);
        }
Example #5
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            string modid = "61";

            if (Request.QueryString["moduleid"] != null && Request.QueryString["moduleid"].Trim() != "")
            {
                modid = Request.QueryString["moduleid"];
            }
            conn    = new DbConnection(MNTTools.GetConnString(modid));
            TableNm = Request.QueryString["TBLNM"];

            object[] param = new object[] { TableNm };

            dtparam       = conn.GetDataTable(Q_PARAMSYS, param, dbtimeout);
            dtparamschema = conn.GetDataTable("SELECT TOP 0 * FROM " + TableNm, null, dbtimeout, true, true);

            clrButton.Attributes["onclick"] = createcontrol();

            creategridquery();
        }