Exemple #1
0
        protected override DialogResult showAddDialog(Apartment entity)
        {
            ApartmentEditor editor = new ApartmentEditor((ApartmentDao)this.dao);

            try
            {
                Apartment apartment = new Apartment();
                if (this.parentWindow.queryCondition != null)
                {
                    apartment.floorplan_id = this.parentWindow.queryCondition.floorplan_id;
                    apartment.building_id  = this.parentWindow.queryCondition.building_id;
                    apartment.stage_id     = this.parentWindow.queryCondition.stage_id;
                    apartment.project_id   = this.parentWindow.queryCondition.project_id;
                }
                editor.entity = apartment;
                editor.renderEntity();
                return(editor.ShowDialog(this));
            }
            catch (Exception ex)
            {
                MyMessageBox msgBox = new MyMessageBox("Data error!", ex, MyConstants.BOX_TYPE_ERROR);
                msgBox.ShowDialog(this);
                return(DialogResult.Abort);
            }
        }
        public ActionResult EditInfo(ApartmentEditor ae)
        {
            if (HttpContext.Request.HttpMethod == "POST")
            {
                try
                {
                    if (ae.Href2 != null)
                    {
                        string path = Path.Combine(Server.MapPath("~/Content/Photos"), Path.GetFileName(ae.Href2.FileName));
                        ae.Href2.SaveAs(path);
                        ae.Href1 = "~/Content/Photos/" + Path.GetFileName(ae.Href2.FileName);
                    }
                    ViewBag.FileStatus = "File uploaded successfully.";
                }
                catch (Exception)
                {
                    ViewBag.FileStatus = "Error while file uploading.";
                }

                if (ae.Forcheck != null && ae.Forcheck.Length == 1)
                {
                    ae.NotAppliable = true;
                }
                else
                {
                    ae.NotAppliable = false;
                }
                _myBll.EditApartment(ae);
                return(View("Edit", ae));
            }
            return(View("Edit", ae));
        }
Exemple #3
0
        protected override DialogResult showEditDialog(Apartment entity)
        {
            ApartmentEditor editor = new ApartmentEditor((ApartmentDao)this.dao);

            try
            {
                editor.entity = entity;
                editor.renderEntity();
                return(editor.ShowDialog(this));
            }
            catch (Exception ex)
            {
                MyMessageBox msgBox = new MyMessageBox("Data error!", ex, MyConstants.BOX_TYPE_ERROR);
                msgBox.ShowDialog(this);
                return(DialogResult.Abort);
            }
        }
        public ActionResult Edit(string ToEdit)
        {
            ApartmentEditor a = _myBll.GetExactApartmentEditor(ToEdit);

            return(View(a));
        }