protected void btnSave_Click(object sender, EventArgs e)
        {
            int fileLen = fileConceptFile.PostedFile.ContentLength;

            byte[] input = new byte[fileLen - 1];
            input = fileConceptFile.FileBytes;
            int      id         = Convert.ToInt32(hidConceptId.Value);
            string   extensioin = fileConceptFile.FileName.Substring(fileConceptFile.FileName.LastIndexOf(".") + 1).ToLower();
            string   fileType   = "";
            EventsBo objBo      = new EventsBo();

            objBo.ConceptIdea    = txtNameOfIdea.Text.Trim();
            objBo.FileType       = fileType;
            objBo.FileBytes      = input;
            objBo.FileExtenstion = extensioin;
            objBo.ConceptId      = id;
            objBo.TCUserid       = TeamID;
            obj.InsertPresentations(objBo);
            txtNameOfIdea.Text = "";
            BindData();
            if (hidConceptId.Value == "0")
            {
                lblMessage.Text = "Presentation saved success.";
            }
            else
            {
                lblMessage.Text = "Presentation Updated success.";
            }
            hidConceptId.Value = "0";
            btnSave.Text       = "Save";
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int fileLen = fileConceptFile.PostedFile.ContentLength;

            byte[] input = new byte[fileLen - 1];
            input = fileConceptFile.FileBytes;
            int id = Convert.ToInt32(hidConceptId.Value);

            string extensioin = fileConceptFile.FileName.Substring(fileConceptFile.FileName.LastIndexOf(".") + 1).ToLower();
            string fileType   = null;

            //set the file type based on File Extension
            switch (extensioin)
            {
            case "doc":
                fileType = "application/vnd.ms-word";
                break;

            case "docx":
                fileType = "application/vnd.ms-word";
                break;

            case "pdf":
                fileType = "application/pdf";
                break;
            }
            EventsBo objBo = new EventsBo();

            objBo.ConceptIdea    = txtNameOfIdea.Text.Trim();
            objBo.FileType       = fileType;
            objBo.FileBytes      = input;
            objBo.FileExtenstion = extensioin;
            objBo.ConceptId      = id;
            objBo.TCUserid       = TeamID;
            obj.InsertConceptNote(objBo);
            txtNameOfIdea.Text = "";
            BindData();
            if (hidConceptId.Value == "0")
            {
                lblMessage.Text = "Concept note saved success.";
            }
            else
            {
                lblMessage.Text = "Concept note Updated success.";
            }
            hidConceptId.Value = "0";
            btnSave.Text       = "Save";
        }
Example #3
0
        public List <EventsBo> GetMonthEvents(string year, string month)
        {
            DBConnection    dbcon  = new DBConnection();
            List <EventsBo> Events = new List <EventsBo>();

            try
            {
                string     strQuery = "Proc_GetEvents";
                SqlCommand cmd      = dbcon.setCommandProperties(strQuery);
                cmd.Parameters.AddWithValue("@year", year);
                cmd.Parameters.AddWithValue("@month", month);
                SqlDataAdapter sda = new SqlDataAdapter(cmd);
                DataSet        ds  = new DataSet();
                sda.Fill(ds);
                cmd.Dispose();

                if (ds.Tables[0].Rows.Count < 0)
                {
                    return(Events);
                }

                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    EventsBo objEvent = new EventsBo()
                    {
                        Title     = Convert.ToString(item["EventName"]),
                        StartDate = Convert.ToString(item["EventDate"]),
                        EndDate   = Convert.ToString(item["EventDate"])
                    };

                    Events.Add(objEvent);
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                if (dbcon != null)
                {
                    dbcon.closeDBConnection();
                }
            }
            return(Events);
        }
Example #4
0
 public bool InsertPresentations(EventsBo objbo)
 {
     try
     {
         SqlParameter[] parameters = new SqlParameter[]
         {
             new SqlParameter("@Name", objbo.ConceptIdea),
             new SqlParameter("@FileType", objbo.FileType),
             new SqlParameter("@Data", objbo.FileBytes),
             new SqlParameter("@Extension", objbo.FileExtenstion),
             new SqlParameter("@UserId", objbo.TCUserid),
             new SqlParameter("@ID", objbo.ConceptId)
         };
         return(SqlDbHelper.ExecuteNonQuery("SaveUpdatePresentations", CommandType.StoredProcedure, parameters));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }