Пример #1
0
 public ActionResult Save(Models.SuggestModel data)
 {
     try
     {
         if (ModelState.IsValid)
         {
             CLayer.Suggest suggest = new CLayer.Suggest()
             {
                 InfoId    = data.InfoId,
                 Name      = data.Name,
                 Location  = data.Location,
                 City      = data.City,
                 CountryId = data.CountryId,
                 Address   = data.Address,
                 Phone     = data.Phone,
                 Email     = data.Email
             };
             BLayer.Suggest.Save(suggest);
             return(RedirectToAction("Posted"));
         }
         else
         {
             return(RedirectToAction("index"));
         }
     }
     catch (Exception ex)
     {
         Common.LogHandler.HandleError(ex);
         return(Redirect("~/ErrorPage"));
     }
 }
Пример #2
0
        public CLayer.Suggest Get(int InfoId)
        {
            CLayer.Suggest            suggest = null;
            List <DataPlug.Parameter> param   = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pInfoId", DataPlug.DataType._BigInt, InfoId));
            DataTable dt = Connection.GetTable("propertysuggestion_Get", param);

            if (dt.Rows.Count > 0)
            {
                suggest                = new CLayer.Suggest();
                suggest.InfoId         = Connection.ToLong(dt.Rows[0]["InfoId"]);
                suggest.Name           = Connection.ToString(dt.Rows[0]["Name"]);
                suggest.Location       = Connection.ToString(dt.Rows[0]["Location"]);
                suggest.City           = Connection.ToString(dt.Rows[0]["City"]);
                suggest.CountryId      = Connection.ToInteger(dt.Rows[0]["CountryId"]);
                suggest.Country        = Connection.ToString(dt.Rows[0]["Country"]);
                suggest.Address        = Connection.ToString(dt.Rows[0]["Address"]);
                suggest.Phone          = Connection.ToString(dt.Rows[0]["Phone"]);
                suggest.Email          = Connection.ToString(dt.Rows[0]["Email"]);
                suggest.SuggestionDate = Connection.ToDate(dt.Rows[0]["SuggestionDate"]);
                suggest.Status         = Connection.ToInteger(dt.Rows[0]["Status"]);
            }
            return(suggest);
        }
Пример #3
0
 public ActionResult Reject(int Id)
 {
     CLayer.Suggest suggest = BLayer.Suggest.Get(Id);
     BLayer.Suggest.SetStatus(Id, (int)StayBazar.Models.SuggestModel.StatusTypes.Rejected);
     if (suggest.Status == (int)StayBazar.Models.SuggestModel.StatusTypes.Viewed)
     {
         return(RedirectToAction("Inbox"));
     }
     else if (suggest.Status == (int)StayBazar.Models.SuggestModel.StatusTypes.Verified)
     {
         return(RedirectToAction("Verified"));
     }
     return(RedirectToAction("Rejected"));
 }
Пример #4
0
        public int Save(CLayer.Suggest suggest)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pInfoId", DataPlug.DataType._BigInt, suggest.InfoId));
            param.Add(Connection.GetParameter("pName", DataPlug.DataType._Varchar, suggest.Name));
            param.Add(Connection.GetParameter("pLocation", DataPlug.DataType._Varchar, suggest.Location));
            param.Add(Connection.GetParameter("pCity", DataPlug.DataType._Varchar, suggest.City));
            param.Add(Connection.GetParameter("pCountryId", DataPlug.DataType._Int, suggest.CountryId));
            param.Add(Connection.GetParameter("pAddress", DataPlug.DataType._Varchar, suggest.Address));
            param.Add(Connection.GetParameter("pPhone", DataPlug.DataType._Varchar, suggest.Phone));
            param.Add(Connection.GetParameter("pEmail", DataPlug.DataType._Varchar, suggest.Email));
            object result = Connection.ExecuteQueryScalar("propertysuggestion_Save", param);

            return(Connection.ToInteger(result));
        }
Пример #5
0
 public ActionResult Edit(int Id)
 {
     try
     {
         CLayer.Suggest suggest = BLayer.Suggest.Get(Id);
         if (suggest.Status == (int)StayBazar.Models.SuggestModel.StatusTypes.NotViewed)
         {
             BLayer.Suggest.SetStatus(Id, (int)StayBazar.Models.SuggestModel.StatusTypes.Viewed);
         }
         return(View(suggest));
     }
     catch (Exception ex)
     {
         StayBazar.Common.LogHandler.HandleError(ex);
         return(Redirect("~/Admin/ErrorPage"));
     }
 }
Пример #6
0
 public static int Save(CLayer.Suggest suggestdata)
 {
     DataLayer.Suggest suggest = new DataLayer.Suggest();
     return(suggest.Save(suggestdata));
 }