Example #1
0
    protected void SaveInterests()
    {
        ActivityBO objActivity = new ActivityBO();

        objActivity.UserId = Userid;
        objActivity.Name   = txtInterests.Text;

        objActivity.Description = txtInterestsDescription.Text;
        objActivity.Type        = Global.INTERESTS;
        if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtInterests.Text + ".jpg")))
        {
            objActivity.Image = txtInterests.Text + ".jpg";
        }
        else if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtInterests.Text + ".png")))
        {
            objActivity.Image = txtInterests.Text + ".png";
        }
        else
        {
            objActivity.Image = "DefaultInterests.png";
        }
        string ActivityId = ActivityBLL.insertActivity(objActivity);

        txtInterests.Text            = String.Empty;
        txtInterestsDescription.Text = String.Empty;
        LoadDataListInterests();
    }
Example #2
0
    protected void SaveActivities()
    {
        ActivityBO objActivity = new ActivityBO();

        objActivity.UserId = Userid;
        objActivity.Name   = txtActivities.Text;

        objActivity.Description = txtActivitiesDescription.Text;
        objActivity.Type        = Global.ACTIVITIES;

        if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtActivities.Text + Global.PICTURE_EXTENSION_JPG)))
        {
            objActivity.Image = txtActivities.Text + Global.PICTURE_EXTENSION_JPG;
        }
        else if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtActivities.Text + ".png")))
        {
            objActivity.Image = txtActivities.Text + ".png";
        }
        else
        {
            objActivity.Image = "DefaultActivities.png";
        }
        string ActivityId = ActivityBLL.insertActivity(objActivity);

        txtActivities.Text            = "";
        txtActivitiesDescription.Text = "";
        LoadDataListActivities();
    }
Example #3
0
        public static string insertActivity(ActivityBO objClass)
        {
            MongoCollection <BsonDocument> objCollection = db.GetCollection <BsonDocument>("c_Activities");

            var query = Query.And(
                Query.EQ("Type", objClass.Type),
                Query.EQ("Name", objClass.Name),
                Query.EQ("UserId", ObjectId.Parse(objClass.UserId)));
            var result = objCollection.Find(query);

            if (!result.Any())
            {
                BsonDocument doc = new BsonDocument {
                    { "UserId", ObjectId.Parse(objClass.UserId) },
                    { "Name", objClass.Name },
                    { "Description", objClass.Description },
                    { "Type", objClass.Type },
                    { "Image", objClass.Image }
                };

                var rt = objCollection.Insert(doc);

                return(doc["_id"].ToString());
            }

            else
            {
                return(null);
            }
        }
Example #4
0
    public static string insertActivity(ActivityBO objActivity)
    {
        if (!String.IsNullOrEmpty(objActivity.Name))
        {
            return(database.insert(objActivity, _tableName));
        }

        return(null);
    }
Example #5
0
        public ActionResult TaskChildrenField(int id)
        {
            int count = ActivityBO.GetInstance().GetTaskCount(id);

            ChildrenFieldUIModel model = new ChildrenFieldUIModel()
            {
                ID        = id,
                Count     = count,
                ClassName = "Task"
            };

            return(View("ChildrenField", model));
        }
Example #6
0
        public static ArrayList getActivitiesByUserId(string Id)
        {
            ArrayList Activities = new ArrayList();

            MongoCollection <Activity> objCollection = db.GetCollection <Activity>("c_Activities");

            ActivityBO objClass = new ActivityBO();

            foreach (Activity item in objCollection.Find(Query.EQ("UserId", ObjectId.Parse(Id))))
            {
                Activities.Add(item.Name);
            }
            return(Activities);
        }
Example #7
0
        public static void updateActivity(ActivityBO objClass)
        {
            MongoCollection <Activity> objCollection = db.GetCollection <Activity>("c_Activities");

            var query  = Query.EQ("_id", ObjectId.Parse(objClass.Id));
            var sortBy = SortBy.Descending("_id");
            var update = Update.Set("UserId", ObjectId.Parse(objClass.UserId))
                         .Set("Name", objClass.Name)
                         .Set("Description", objClass.Description)
                         .Set("Type", objClass.Type)
                         .Set("Image", objClass.Image)

            ;
            var result = objCollection.FindAndModify(query, sortBy, update, true);
        }
Example #8
0
        public static ActivityBO getActivityByActivityId(string Id)
        {
            MongoCollection <Activity> objCollection = db.GetCollection <Activity>("c_Activities");

            ActivityBO objClass = new ActivityBO();

            foreach (Activity item in objCollection.Find(Query.EQ("_id", ObjectId.Parse(Id))))
            {
                objClass.Id          = item._id.ToString();
                objClass.UserId      = item.UserId.ToString();
                objClass.Name        = item.Name;
                objClass.Type        = item.Type;
                objClass.Description = item.Description;
                objClass.Image       = item.Image;
                break;
            }
            return(objClass);
        }
Example #9
0
        /// <summary>
        /// To Get Activity Details
        /// </summary>
        /// <returns></returns>
        public ActivityList GetActivity()
        {
            OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_GET_MST_CDAP_ACTIVITY";

            cmd             = new OracleCommand(proc, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr            = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            ActivityBO       objActivityBO = null;
            ActivityList     Activity      = new ActivityList();

            while (dr.Read())
            {
                objActivityBO = new ActivityBO();
                objActivityBO.Cdap_activityid   = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("Id"))));
                objActivityBO.Cdap_activityname = dr.GetValue(dr.GetOrdinal("Name")).ToString();
                Activity.Add(objActivityBO);
            }
            dr.Close();
            return(Activity);
        }
Example #10
0
        public ActionResult Delete(int id)
        {
            ActivityBO.GetInstance().Delete(id);

            return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
        }
Example #11
0
        public ActionResult Create(ActivityDataModel activity)
        {
            ActivityBO.GetInstance().Create(activity);

            return(RedirectToAction("Index"));
        }
Example #12
0
 public ActionResult Edit(int id)
 {
     return(View(ActivityBO.GetInstance().Get(id)));
 }
Example #13
0
        //
        // GET: /ManageActivity/

        public ActionResult Index(int id = 0)
        {
            return(View(ActivityBO.GetInstance().GetAll(id)));
        }