示例#1
0
        public ActionResult Detail(string PID)
        {
            Model.Content.Builds          builds = BDs.GetModelByValue("select top 1* from Builds  where isdel=0 and  pid='" + PID + "'", null);
            List <Model.Content.BDetails> bdt    = Details.GetModelsByValue("SELECT * FROM BDetails where isdel=0 and pid='" + PID + "'", null);

            ViewBag.Details = bdt;
            return(View(builds));
        }
示例#2
0
        public ActionResult Delete(int value)
        {
            Model.Content.BDetails bDetails = Details.GetModelByValue("SELECT top 1 * FROM BDetails where isdel=0 and id=" + value, null);
            bDetails.IsDel = 1;
            bDetails.Time  = DateTime.Now;
            bool bol = Details.Update(bDetails);

            return(Json(new { Code = bol, Message = "" }, JsonRequestBehavior.DenyGet));
        }
示例#3
0
        public ActionResult EditSave(string Name, string Address, decimal AveragePrice, string Business, string School, string Hospital,
                                     string Enjoy, string DeadLine, decimal Areas, decimal Green, int Years, string Property, string Develops, string Certificate, string PID)
        {
            Model.Content.Builds builds = BD.GetModelByValue("select top 1* from Builds  where isdel=0 and  pid='" + PID + "'", null);
            builds.Name         = Name;
            builds.Address      = Address;
            builds.AveragePrice = AveragePrice;
            builds.Business     = Business;
            builds.School       = School;
            builds.Hospital     = Hospital;
            builds.Enjoy        = Enjoy;
            builds.DeadLine     = DeadLine;
            builds.Areas        = Areas;
            builds.Green        = Green;
            builds.Years        = Years;
            builds.Property     = Property;
            builds.Developers   = Develops;
            builds.Certificate  = Certificate;
            bool ret = BD.Update(builds);

            return(Json(new { Code = ret }));
        }
示例#4
0
        public JsonResult UploadSave(string ID, int Type, string Stract)
        {
            string pathForSaving = Server.MapPath("~/");
            string sqlcount      = "select top 1* from builds where isdel=0 and  PID='" + ID + "'";

            Model.Content.Builds builds = BD.GetModelByValue(sqlcount, null);
            try
            {
                foreach (string strfile in Request.Files)
                {
                    try
                    {
                        HttpPostedFileBase uploadFile = Request.Files[strfile] as HttpPostedFileBase;
                        if (uploadFile != null && uploadFile.ContentLength > 0)
                        {
                            var paths = DateTime.Now.ToString("yyMMdd_hhmmss") + "_" + uploadFile.FileName;
                            uploadFile.SaveAs(Server.MapPath("/UploadFiles/") + paths);
                            //添加附件信息
                            Model.Content.BDetails bDetails = new Model.Content.BDetails();
                            bDetails.Person  = uploadFile.FileName;
                            bDetails.PID     = ID;
                            bDetails.Urls    = "/UploadFiles/" + paths;
                            bDetails.Time    = DateTime.Now;
                            bDetails.Explain = Stract;
                            bDetails.Type    = Type;
                            Detail.Insert(bDetails);
                        }
                    }
                    catch (Exception ee)
                    {
                        //邮件通知
                    }
                }
            }
            catch (Exception ee)
            {
                return(Json(new { code = 1 }, JsonRequestBehavior.DenyGet));
            }
            return(Json(new { code = 0 }, JsonRequestBehavior.DenyGet));
        }