Пример #1
0
        //==========================Cast wise Village Population===========================
        public bool InsertVillCastWisePopulation(VILL_CASTE VillCast)
        {
            db.Open();


            string sql = "INSERT INTO [dbo].[VILL_CASTE]";

            sql = sql + "([vill_id],[caste_name],[caste_population]) ";
            sql = sql + " VALUES(@vill_id, @caste_name, @caste_population) ";
            var data = new
            {
                vill_id          = VillCast.vill_id,
                caste_name       = VillCast.caste_name,
                caste_population = VillCast.caste_population,
            };

            var Constituency = db.Execute(sql, data);

            if (Constituency > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        public bool UpdateVillCastWisePopulation(VILL_CASTE VillCast)
        {
            db.Open();


            string sql = "Update [dbo].[VILL_CASTE] ";

            sql = sql + " set [vill_id]=@vill_id,[caste_name]=@caste_name,[caste_population]=@caste_population ";
            sql = sql + " where caste_id=@caste_id";
            var data = new
            {
                vill_id          = VillCast.vill_id,
                caste_name       = VillCast.caste_name,
                caste_population = VillCast.caste_population,
                caste_id         = VillCast.caste_id,
            };
            var Constituency = db.Execute(sql, data);

            if (Constituency > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
        public ActionResult UpdateVillagePopulation(VILL_CASTE VillPopulation)
        {
            VillageProfileRepo villRepo = new VillageProfileRepo();
            var result = villRepo.UpdateVillCastWisePopulation(VillPopulation);

            if (result)
            {
                return(Json(new { status = "Success", data = "" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { status = "error", data = "" }, JsonRequestBehavior.AllowGet));
            }
        }