Exemplo n.º 1
0
 public ActionResult ChangeStatus(string status, int cid, string message)
 {
     try
     {
         dashrdku_database db    = new dashrdku_database();
         FollowUpMaster    model = new FollowUpMaster();
         UserInfoModel     user  = Session["userInfo"] as UserInfoModel;
         model.RefCandidateId  = cid;
         model.FollowUpBy      = user.UserRocketName;
         model.FollowUpDate    = DateTime.Now.Date;
         model.FollowUpTime    = DateTime.Now.TimeOfDay;
         model.FollowUpMessage = message;
         model.FollowUpStatus  = status;
         db.FollowUpMasters.Add(model);
         db.SaveChanges();
         TempData["alert"] = new AlertBoxModel()
         {
             Type = "Success", Message = "Follow Up Message Saved!"
         };
     }
     catch (Exception ex)
     {
         TempData["alert"] = new AlertBoxModel()
         {
             Type = "Error", Message = ex.Message
         };
     }
     return(RedirectToAction("GetTimeLine2"));
 }
Exemplo n.º 2
0
        public int UpdateRecord(ref FollowUpMaster Entity_Call, out string StrError)
        {
            int iInsert = 0;

            StrError = string.Empty;
            try
            {
                SqlParameter pAction       = new SqlParameter(FollowUpMaster._Action, SqlDbType.BigInt);
                SqlParameter pFolloupId    = new SqlParameter(FollowUpMaster._FollowUpId, SqlDbType.BigInt);
                SqlParameter pFollowupType = new SqlParameter(FollowUpMaster._FollowUpType, SqlDbType.BigInt);
                SqlParameter pReason       = new SqlParameter(FollowUpMaster._Reason, SqlDbType.NVarChar);

                SqlParameter pCreatedBy   = new SqlParameter(FollowUpMaster._UserId, SqlDbType.BigInt);
                SqlParameter pCreatedDate = new SqlParameter(FollowUpMaster._LoginDate, SqlDbType.DateTime);

                pAction.Value       = 2;
                pFolloupId.Value    = Entity_Call.FollowUpId;
                pFollowupType.Value = Entity_Call.FollowUpType;
                pReason.Value       = Entity_Call.Reason;
                pCreatedBy.Value    = Entity_Call.UserId;
                pCreatedDate.Value  = Entity_Call.LoginDate;

                SqlParameter[] param = new SqlParameter[] { pAction, pFolloupId, pFollowupType, pReason, pCreatedBy, pCreatedDate };
                Open(CONNECTION_STRING);
                BeginTransaction();
                iInsert = SQLHelper.ExecuteNonQuery(_Connection, _Transaction, CommandType.StoredProcedure, FollowUpMaster.SP_FollowUpMaster, param);

                if (iInsert > 0)
                {
                    CommitTransaction();
                }
                else
                {
                    RollBackTransaction();
                }
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                StrError = ex.Message;
            }
            finally
            {
                Close();
            }
            return(iInsert);
        }