protected void createnewdirectory() { objfile.action = "insert"; objfile.parent = hidparentid.Value; objfile.category = hidcategoryid.Value; objfile.loginid = ViewState["driveid"].ToString(); objfile.createdby = Session["userid"].ToString(); objfile.type = ViewState["drive"].ToString(); objfile.name = txtdirname.Text; objfile.mName = txtdirname.Text; objfile.nid = ""; objfile.dob = GeneralMethod.getLocalDateTime(); objfile.description = "Created by " + Session["userid"].ToString(); objfile.companyid = Session["companyId"].ToString(); objfile.imgurl = GeneralMethod.getfilicon("folder", ""); //objfile.meetingid = hidid2.Value; objfile.linktype = "folder"; objfile.extension = ""; ds = objfile.managefiles(); txtdirname.Text = ""; // hidparentid.Value = ds.Tables[0].Rows[0]["nid"].ToString(); bindgrid(); fillcategory(); }
protected void btnupload_Click(object sender, EventArgs e) { string datetime = DateTime.Now.ToFileTimeUtc().ToString(); if (Session["file"] != null) { tblfile = (DataTable)Session["file"]; if (tblfile.Rows.Count > 0) { try { objfile.companyid = Session["CompanyId"].ToString(); objfile.action = "insert"; objfile.dob = GeneralMethod.getLocalDateTime(); objfile.nid = ""; objfile.description = "File uploaded by " + Session["userid"].ToString(); objfile.parent = hidparentid.Value; objfile.category = "0"; for (int i = 0; i < tblfile.Rows.Count; i++) { objfile.name = tblfile.Rows[i]["originalname"].ToString();; objfile.mName = tblfile.Rows[i]["savename"].ToString(); objfile.type = ViewState["drive"].ToString(); objfile.linktype = "file"; objfile.imgurl = GeneralMethod.getfilicon("file", tblfile.Rows[i]["ext"].ToString().ToUpper()); objfile.loginid = ViewState["driveid"].ToString(); objfile.createdby = Session["userid"].ToString(); if (ViewState["drive"].ToString() == "meetingfile" || ViewState["drive"].ToString() == "shared") { objda.loginid = hidid2.Value; } //objfile.meetingid = hidid2.Value; objfile.extension = tblfile.Rows[i]["ext"].ToString(); ds = objfile.managefiles(); } bindgrid(); Session["file"] = null; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script type='text/javascript'>closepop('popupload');</script>", false); } catch { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script type='text/javascript'>alert('Error in Uploading');</script>", false); return; } } else { Session["file"] = null; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script type='text/javascript'>alert('File does not exist.');</script>", false); return; } } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script type='text/javascript'>alert('File does not exist.');</script>", false); return; } }