Esempio n. 1
0
 public string BlockPostAdvertisements(PropSales objSale, string associateID, int activeV)
 {
     if (associateID != null && associateID != "")
     {
         SqlCommand cmd = new SqlCommand("proc_PostAdvertisement", objCon.Con);
         cmd.CommandType = CommandType.StoredProcedure;
         objCon.Con.Open();
         cmd.Parameters.AddWithValue("@associateID", Convert.ToInt16(associateID));
         cmd.Parameters.AddWithValue("@SubCategoryId", objSale.Subcategory);
         cmd.Parameters.AddWithValue("@flag", activeV);
         cmd.Parameters.AddWithValue("@Action", "BlockedAdvt");
         int a = Convert.ToInt16(cmd.ExecuteNonQuery());
         objCon.Con.Close();
         if (a > 0)
         {
             return(a.ToString());
         }
         else
         {
             return(ClsCommon.InactiveValue.ToString());
         }
     }
     else
     {
         return("Not Valid");
     }
 }
Esempio n. 2
0
        public string RemoveSaleRecord(PropSales objSale, string associateID)
        {
            if (associateID != null && associateID != "")
            {
                SqlCommand cmd = new SqlCommand("proc_PostAdvertisement", objCon.Con);
                cmd.CommandType = CommandType.StoredProcedure;
                objCon.Con.Open();

                cmd.Parameters.AddWithValue("@advertisementID", objSale.ID);
                cmd.Parameters.AddWithValue("@Action", "DeleteRcd");
                int a = Convert.ToInt16(cmd.ExecuteNonQuery());
                objCon.Con.Close();
                if (a > 0)
                {
                    return(a.ToString());
                }
                else
                {
                    return(ClsCommon.InactiveValue.ToString());
                }
            }
            else
            {
                return("Not Valid");
            }
        }
Esempio n. 3
0
        public string UpdateSale(int CategoryId, int SubCategoryId, string title, string Features, string address, string contactNo, string description, string countryID, string StateID, string cityID, string zipcode, float amount, int id)
        {
            string str = string.Empty;

            if (Session["associate"].ToString() != "" || Session["associate"].ToString() != null)
            {
                PropSales proSale = new PropSales();
                proSale.AssociateID = Convert.ToInt16(Session["associate"]);
                proSale.CategoryID  = CategoryId;
                proSale.Subcategory = SubCategoryId;
                proSale.Title       = title;
                proSale.Features    = Features;
                proSale.Address     = address;
                proSale.ContactNo   = contactNo;
                proSale.Description = description;
                proSale.CountryID   = countryID;
                proSale.StateID     = StateID;
                proSale.CityID      = cityID;
                //proSale.IsfeaturedID = isFeatured;
                proSale.Zipcode = zipcode;
                proSale.Amount  = amount;
                proSale.ID      = id;
                BllSale objSale = new BllSale();
                str = objSale.RecordupdateSale(proSale, Session["associate"].ToString());
                return(str);
            }
            else
            {
                return("Error in Authentication");
            }
        }
Esempio n. 4
0
        public void ViewRecords()
        {
            List <PropSales> stq = new List <PropSales>();
            string           cn  = ConfigurationManager.ConnectionStrings["con"].ConnectionString;

            using (SqlConnection con = new SqlConnection(cn))
            {
                SqlCommand cmd = new SqlCommand("proc_DisplayAdvertisements", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@action", "SubcategoryWise");
                cmd.Parameters.AddWithValue("@ZipCode", "501");
                cmd.Parameters.AddWithValue("@subCategoryID", 1);
                con.Open();
                SqlDataReader dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    PropSales sq = new PropSales();
                    sq.ID           = Convert.ToInt16(dr["advertisementID"]);
                    sq.Title        = dr["title"].ToString();
                    sq.Address      = dr["address"].ToString();
                    sq.Description  = dr["description"].ToString();
                    sq.Amount       = Convert.ToDouble(dr["cost"].ToString());
                    sq.IsfeaturedID = Convert.ToInt16(dr["isfeatured"].ToString());
                    sq.MainImg      = dr["advMainImage"].ToString();
                    sq.CityName     = dr["City"].ToString();
                    sq.Zipcode      = dr["ZipCode"].ToString();
                    stq.Add(sq);
                }
            }
            JavaScriptSerializer js = new JavaScriptSerializer();

            Context.Response.Write(js.Serialize(stq));
        }
Esempio n. 5
0
        public string Blockadvertisements(int ID, int activeV)
        {
            string str = string.Empty;

            if (Session["associate"].ToString() != "" || Session["associate"].ToString() != null)
            {
                PropSales objProperty = new PropSales();
                objProperty.Subcategory = ID;
                BllSale ObjLeadStatus = new BllSale();
                str = ObjLeadStatus.BlockedRecords(objProperty, Session["associate"].ToString(), activeV);
                return(str);
            }
            else
            {
                return("Error in Authentication");
            }
        }
Esempio n. 6
0
        //public string RecordInsert(PropSales objProperty, string associateID, object FeatureID)
        public string RecordInsert(PropSales objProperty, string associateID)
        {
            DllSale objDal = new DllSale();

            try
            {
                return(objDal.InsertSale(objProperty, associateID));
            }
            catch (Exception info)
            {
                throw info;
            }
            finally
            {
                objDal = null;
            }
        }
Esempio n. 7
0
        public string BlockedRecords(PropSales objProperty, string associateID, int activeV)
        {
            DllSale objDal = new DllSale();

            try
            {
                return(objDal.BlockPostAdvertisements(objProperty, associateID, activeV));
            }
            catch (Exception info)
            {
                throw info;
            }
            finally
            {
                objDal = null;
            }
        }
Esempio n. 8
0
        public string UpdatePostAdvertisementsCost(int advtID, float amount)
        {
            string str = string.Empty;

            if (Session["associate"].ToString() != "" || Session["associate"].ToString() != null)
            {
                PropSales objProperty = new PropSales();
                objProperty.ID = advtID;
                BllSale objSale = new BllSale();
                str = objSale.UpdatePostAdvertisementsCost(Session["associate"].ToString(), advtID, amount);
                return(str);
            }
            else
            {
                return("Error in Authentication");
            }
        }
Esempio n. 9
0
        public string DeleteDataFromadvertisement(int advtID)
        {
            string str = string.Empty;

            if (Session["associate"].ToString() != "" || Session["associate"].ToString() != null)
            {
                PropSales objProperty = new PropSales();
                objProperty.ID = advtID;
                BllSale objSale = new BllSale();
                str = objSale.RecordDelete(objProperty, Session["associate"].ToString());
                return(str);
            }
            else
            {
                return("Error in Authentication");
            }
        }
Esempio n. 10
0
 public string UpdateFeaturedAdv(PropSales objSale, string associateID)
 {
     if (associateID != null && associateID != "")
     {
         SqlCommand cmd = new SqlCommand("proc_PostAdvertisement", objCon.Con);
         cmd.CommandType = CommandType.StoredProcedure;
         objCon.Con.Open();
         //try
         //{
         cmd.Parameters.AddWithValue("@associateID", Convert.ToInt16(associateID));
         cmd.Parameters.AddWithValue("@CategoryID", objSale.CategoryID);
         cmd.Parameters.AddWithValue("@SubCategoryId", objSale.Subcategory);
         cmd.Parameters.AddWithValue("@title", objSale.Title);
         cmd.Parameters.AddWithValue("@feature", objSale.Features);
         cmd.Parameters.AddWithValue("@address", objSale.Address);
         cmd.Parameters.AddWithValue("@email", objSale.Email);
         cmd.Parameters.AddWithValue("@contactNo", objSale.ContactNo);
         cmd.Parameters.AddWithValue("@description", objSale.Description);
         // cmd.Parameters.AddWithValue("@advMainImage", objSale.adv);
         cmd.Parameters.AddWithValue("@countryID", objSale.CountryID);
         cmd.Parameters.AddWithValue("@StateID", objSale.StateID);
         cmd.Parameters.AddWithValue("@cityID", objSale.CityID);
         cmd.Parameters.AddWithValue("@zipcode", objSale.Zipcode);
         cmd.Parameters.AddWithValue("@isFeatured", objSale.IsfeaturedID);
         cmd.Parameters.AddWithValue("@amount", objSale.Amount);
         cmd.Parameters.AddWithValue("@advertisementID", objSale.ID);
         cmd.Parameters.AddWithValue("@Action", "Update");
         int a = Convert.ToInt16(cmd.ExecuteNonQuery());
         objCon.Con.Close();
         if (a > 0)
         {
             //DataTable dt = new DataTable();
             //dt.Columns.Add("featureID");
             //dt.Columns.Add("advertisementID");
             //string[] totalEmp = FeatureID.ToString().Split(',');
             //for (int i = 0; i < totalEmp.Length; i++)
             //{
             //    DataRow dr = dt.NewRow();
             //    dr["featureID"] = totalEmp[i];
             //    dr["advertisementID"] = a;
             //    dt.Rows.Add(dr);
             //}
             //SqlCommand cmdFeature = new SqlCommand("proc_AdvFeature", objCon.Con);
             //cmdFeature.CommandType = CommandType.StoredProcedure;
             //objCon.Con.Open();
             //cmdFeature.Parameters.AddWithValue("@Details", dt);
             //int b = cmdFeature.ExecuteNonQuery();
             //objCon.Con.Close();
             //if (b >= 1)
             //{
             return(a.ToString());
             //}
             //else
             //{
             //return ClsCommon.InactiveValue.ToString();
             //}
         }
         else
         {
             return(ClsCommon.InactiveValue.ToString());
         }
         //}
         //catch (Exception showError)
         //{
         //    throw showError;
         //}
         //finally
         //{
         //    cmd.Dispose();
         //    objCon.Con.Close();
         //    objCon.Con.Dispose();
         //}
     }
     else
     {
         return("Not Valid");
     }
 }