Esempio n. 1
0
    private void displayrecords()
    {
        string  rolename   = Session["RoleName"].ToString();
        string  sql        = "select roleid from SubMenuPermission where RoleName='" + rolename + "' ";
        int     roleid     = cc.ExecuteScalar1(sql);
        string  sqldisplay = "select Id,usrFirstName+''+usrLastName as username,usrMobileNo,FileName,Committee_url from UserMaster inner join committeedetail on UserMaster.usrUserId =committeedetail.userid where roleid='" + roleid + "'";
        DataSet ds         = cc.ExecuteDataset(sqldisplay);

        gvUser.DataSource = ds.Tables[0];
        gvUser.DataBind();
    }
Esempio n. 2
0
    private void displayrecords()
    {
        string  rolename   = Session["RoleName"].ToString();
        string  sql        = "select roleid from SubMenuPermission where RoleName='" + rolename + "' ";
        int     roleid     = cc.ExecuteScalar1(sql);
        string  sqldisplay = "select Committee_url,FileName from committeedetail where roleid='" + roleid + "'";
        DataSet ds         = cc.ExecuteDataset(sqldisplay);

        GridShow.DataSource = ds.Tables[0];
        GridShow.DataBind();
    }
Esempio n. 3
0
 public int DALinsertFileUpload(BLLFileUpload bllfile)
 {
     using (SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]))
     {
         try
         {
             string sql1 = "insert into committeedetail(Committee_name,Committee_url,FileName,roleid,userid)values('" + bllfile.Commiteename + "','" + bllfile.Commiteeurl + "','" + bllfile.Filename + "','" + bllfile.Roleid + "','" + bllfile.Userid + "')";
             status = cc.ExecuteScalar1(sql1);
         }
         catch (Exception ex)
         {
         }
     }
     return(status);
 }
Esempio n. 4
0
 public void AddUDISE_SCHOOL(string SchoolCode, string SchoolName, string Mgmt, string Type, string ClassL, string ClassH)
 {
     try
     {
         string CheckCode = "select SchoolId from UDISE_SchoolMaster where SchoolCode='" + SchoolCode + "'";
         status = cc.ExecuteScalar1(CheckCode);
         if (!(status == null || status == 0))
         {
             string str = "Update  UDISE_SchoolMaster  set SchoolName='" + SchoolName + "',Management='" + Mgmt + "',SchoolType='" + Type + "',LowClass=" + ClassL + ", HighClass=" + ClassH + " where SchoolCode='" + SchoolCode + "'";
             status = cc.ExecuteNonQuery(str);
         }
         else
         {
             string str = "insert into UDISE_SchoolMaster " +
                          "(SchoolCode,SchoolName,Management,SchoolType,LowClass,HighClass)values" +
                          "('" + SchoolCode + "','" + SchoolName + "','" + Mgmt + "','" + Type + "'," + ClassL + "," + ClassH + ")";
             status = cc.ExecuteNonQuery(str);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 5
0
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        string Role = Convert.ToString(Session["RoleId"]);

        if (Role == "28" || Role == "29")
        {
            string   Id     = Request.QueryString["Id"];
            string   userid = Session["MarketingUser"].ToString();
            DateTime date   = System.DateTime.Now;
            if (myFile.HasFile)
            {
                try
                {
                    string path = "";

                    filename = myFile.FileName;
                    string mobileno = Convert.ToString(Session["MobileNumber"]);

                    string  sql           = "select Committee_name,Committee_url from committeedetail where Id='" + Id + "'";
                    DataSet dset          = cc.ExecuteDataset(sql);
                    string  committeename = Convert.ToString(dset.Tables[0].Rows[0]["Committee_name"]);
                    string  comitteeurl   = Convert.ToString(dset.Tables[0].Rows[0]["Committee_url"]);

                    if (Id != "")
                    {
                        string thisDir = Server.MapPath("~/downloadfilesMLA/");

                        System.IO.Directory.CreateDirectory(thisDir + committeename + "");


                        string newpa = "" + thisDir + committeename + "";

                        string newpath = Server.MapPath("~/downloadfilesMLA/" + committeename + "");

                        path = newpath + "\\" + myFile.FileName;


                        string ePath = newpa;
                        System.IO.DirectoryInfo di = new DirectoryInfo(ePath);
                        FileInfo[] fiArr           = di.GetFiles();
                        foreach (FileInfo fi in fiArr)
                        {
                            fi.Delete();
                        }

                        myFile.SaveAs(path);
                        string type = System.IO.Path.GetExtension(myFile.FileName);

                        string sqlupdate = "update committeedetail set FileName='" + filename + "',userid='" + userid + "' where Id='" + Id + "' and Committee_name='" + committeename + "'";
                        int    status    = cc.ExecuteScalar1(sqlupdate);
                        if (status == 0)
                        {
                            displayrecords();
                            //ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('File added Successfully')", true);
                            Response.Write("<script>(alert)('File Uploaded Successfully')</script>");
                        }
                    }
                }


                catch (Exception ex)
                { }
            }
        }
        else if (Role == "38")
        {
            string   Id     = Request.QueryString["Id"];
            string   userid = Session["MarketingUser"].ToString();
            DateTime date   = System.DateTime.Now;
            if (myFile.HasFile)
            {
                try
                {
                    string path = "";

                    filename = myFile.FileName;
                    string mobileno = Convert.ToString(Session["MobileNumber"]);

                    string  sql           = "select Committee_name,Committee_url from committeedetail where Id='" + Id + "'";
                    DataSet dset          = cc.ExecuteDataset(sql);
                    string  committeename = Convert.ToString(dset.Tables[0].Rows[0]["Committee_name"]);
                    string  comitteeurl   = Convert.ToString(dset.Tables[0].Rows[0]["Committee_url"]);

                    if (Id != "")
                    {
                        string thisDir = Server.MapPath("~/download files/");

                        System.IO.Directory.CreateDirectory(thisDir + committeename + "");


                        string newpa = "" + thisDir + committeename + "";

                        string newpath = Server.MapPath("~/download files/" + committeename + "");

                        path = newpath + "\\" + myFile.FileName;


                        string ePath = newpa;
                        System.IO.DirectoryInfo di = new DirectoryInfo(ePath);
                        FileInfo[] fiArr           = di.GetFiles();
                        foreach (FileInfo fi in fiArr)
                        {
                            fi.Delete();
                        }

                        myFile.SaveAs(path);
                        string type = System.IO.Path.GetExtension(myFile.FileName);

                        string sqlupdate = "update committeedetail set FileName='" + filename + "',userid='" + userid + "' where Id='" + Id + "' and Committee_name='" + committeename + "'";
                        int    status    = cc.ExecuteScalar1(sqlupdate);
                        if (status == 0)
                        {
                            displayrecords();
                            //ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('File added Successfully')", true);
                            Response.Write("<script>(alert)('File Uploaded Successfully')</script>");
                        }
                    }
                }


                catch (Exception ex)
                { }
            }
        }
        else if (Role == "37")
        {
            string   userid        = Session["MarketingUser"].ToString();
            DateTime date          = System.DateTime.Now;
            string   Id            = "32";
            string   sql           = "select Committee_name,Committee_url from committeedetail where Id='" + Id + "'";
            DataSet  dset          = cc.ExecuteDataset(sql);
            string   committeename = Convert.ToString(dset.Tables[0].Rows[0]["Committee_name"]);
            string   comitteeurl   = Convert.ToString(dset.Tables[0].Rows[0]["Committee_url"]);
            if (myFile.HasFile)
            {
                try
                {
                    string path = "";

                    filename = myFile.FileName;
                    string mobileno = Convert.ToString(Session["MobileNumber"]);
                    if (Id != "")
                    {
                        string thisDir = Server.MapPath("~/downloadfilesMPCC/");



                        System.IO.Directory.CreateDirectory(thisDir);

                        string newpath = Server.MapPath("~/downloadfilesMPCC/");

                        path = newpath + "\\" + myFile.FileName;


                        string ePath = newpath;
                        System.IO.DirectoryInfo di = new DirectoryInfo(thisDir);
                        FileInfo[] fiArr           = di.GetFiles();
                        foreach (FileInfo fi in fiArr)
                        {
                            fi.Delete();
                        }

                        myFile.SaveAs(path);


                        string sqlupdate = "update committeedetail set FileName='" + filename + "',userid='" + userid + "',roleid='" + Role + "' where Id='" + Id + "' and Committee_name='" + committeename + "'";
                        int    status    = cc.ExecuteScalar1(sqlupdate);
                        if (status == 0)
                        {
                            displayrecords();

                            Response.Write("<script>(alert)('File Uploaded Successfully')</script>");
                        }
                    }
                }


                catch (Exception ex)
                { }
            }
        }
    }