Ejemplo n.º 1
0
        public int DeleteItem(Int64 itemID)
        {
            Database  db        = SqlHelper.CreateConnection(SqlHelper.MyConnection);
            DbCommand dbCommand = db.GetStoredProcCommand("HBankRate_Delete");

            db.AddInParameter(dbCommand, "HouseRateID", DbType.Int64, itemID);
            DBgl_FriendRequest objItem = DBgl_FriendRequestManager.GetItemByID(itemID);

            //if (objItem != null) { RemoveCache(objItem); };
            return(db.ExecuteNonQuery(dbCommand));
            // return DataHelper.ExecuteNonQuery("", itemID);
        }
Ejemplo n.º 2
0
        public static DBgl_FriendRequest GetUserInRequestList(Guid WorkflowId, Guid RequestTokenId)
        {
            DBgl_FriendRequest           objItem = null;
            DBgl_FriendRequestCollection objcol  = DBgl_FriendRequestManager.GetAllItemByWfId(WorkflowId);

            for (int i = 0; i < objcol.Count; i++)
            {
                if (objcol[i].requesttoken == RequestTokenId)
                {
                    objItem = objcol[i];
                    break;
                }
            }
            return(objItem);
        }
Ejemplo n.º 3
0
        public static int DeleteItem(int ItemId)
        {
            Database  db        = SqlHelper.CreateConnection(SqlHelper.MyConnection);
            DbCommand dbCommand = db.GetStoredProcCommand("gl_FriendRequest_Delete");

            db.AddInParameter(dbCommand, "RequestId", DbType.Int32, ItemId);
            DBgl_FriendRequest objItem = DBgl_FriendRequestManager.GetItemByID(ItemId);

            if (objItem != null)
            {
                RemoveCache(objItem);
            }
            ;
            return(db.ExecuteNonQuery(dbCommand));
        }
Ejemplo n.º 4
0
        public static DBgl_Workflow AddItem(int WStatus,
                                            DateTime CreatedDate,
                                            string CreatedUser,
                                            bool Published,
                                            string WorkflowName,
                                            string SmallDesc,
                                            DateTime FromDate,
                                            DateTime ToDate, decimal BudgetAmt, decimal ReceiveAmt, decimal PaymentAmnt, decimal CashOnHandAmt, int Members,
                                            bool isClose, int Ratting, string ImgUrl, int SharingType)
        {
            DBgl_Workflow item      = null;
            Database      db        = SqlHelper.CreateConnection(SqlHelper.MyConnection);
            DbCommand     dbCommand = db.GetStoredProcCommand("gl_Workflow_Add");

            db.AddOutParameter(dbCommand, "WorkflowID", DbType.Guid, 0);

            db.AddInParameter(dbCommand, "WStatus", DbType.Int32, WStatus);

            db.AddInParameter(dbCommand, "CreatedDate", DbType.DateTime, CreatedDate);

            db.AddInParameter(dbCommand, "CreatedUser", DbType.String, CreatedUser);

            db.AddInParameter(dbCommand, "Published", DbType.Boolean, Published);

            db.AddInParameter(dbCommand, "WorkflowName", DbType.String, HtmlTag.Strip(WorkflowName));

            db.AddInParameter(dbCommand, "SmallDesc", DbType.String, SmallDesc);

            db.AddInParameter(dbCommand, "FromDate", DbType.DateTime, FromDate);

            db.AddInParameter(dbCommand, "ToDate", DbType.DateTime, ToDate);
            db.AddInParameter(dbCommand, "BudgetAmt", DbType.Decimal, BudgetAmt);

            db.AddInParameter(dbCommand, "ReceiveAmt", DbType.Decimal, ReceiveAmt);

            db.AddInParameter(dbCommand, "PaymentAmnt", DbType.Decimal, PaymentAmnt);

            db.AddInParameter(dbCommand, "CashOnHandAmt", DbType.Decimal, CashOnHandAmt);
            db.AddInParameter(dbCommand, "Members", DbType.Int32, Members);

            db.AddInParameter(dbCommand, "isClose", DbType.Boolean, isClose);

            db.AddInParameter(dbCommand, "Ratting", DbType.Int32, Ratting);

            db.AddInParameter(dbCommand, "ImgUrl", DbType.String, ImgUrl);
            db.AddInParameter(dbCommand, "SharingType", DbType.Int32, SharingType);
            if (db.ExecuteNonQuery(dbCommand) > 0)
            {
                Guid itemID = (Guid)(db.GetParameterValue(dbCommand, "@WorkflowID"));
                item = GetItemByID(itemID);
                if (item != null)
                {
                    //add this user to Friend Request
                    DBtblUser          objUser    = DBtblUserManager.GetItemByUser(CreatedUser);
                    DBgl_FriendRequest objRequest = DBgl_FriendRequestManager.AddItem(objUser.Username, objUser.Username,
                                                                                      objUser.Email, Guid.NewGuid(), DateTime.Now,
                                                                                      objUser.Username, item.WorkflowID, true, true, false, 0, 0, "", (int)FriendRequestEnum.gl_Invited);
                    //UPdate USerInfo Legs
                    DBgl_UserInfo objInfo = DBgl_UserInfoManager.GetItemByUserName(CreatedUser);
                    if (objInfo != null)
                    {
                        int joinlegs    = objInfo.MyLegs + 1;
                        int myenjoyLegs = objInfo.EnjoyLegs + 1;
                        objInfo = DBgl_UserInfoManager.UpdateItem(objInfo.UserInfId, objInfo.UserId,
                                                                  objInfo.UserName, objInfo.CreatedDate, objInfo.Mobile, objInfo.CountryId, objInfo.LocationId, objInfo.Address,
                                                                  objInfo.Rating, joinlegs, myenjoyLegs, objInfo.Sex, objInfo.createdUser);
                    }
                    RemoveCache(item);
                }
            }
            return(item);
        }