Beispiel #1
0
        public ActionResult ManageAssetDocPic(string appraisalID, string appraisalManageType)//รูปเอกสารสิทธิ์
        {
            int thisID = Convert.ToInt32(ContentHelpers.Decode(appraisalID));

            getAppraisalAssetCode(thisID);
            string thisManageType = ContentHelpers.Decode(appraisalManageType);

            TempData["appraisalManageType"] = appraisalManageType != string.Empty ? ContentHelpers.Decode(appraisalManageType) : "";

            string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));

            List <UploadPictureAssetModel> listImages = AppraisalService.GetUploadPictureAsset(0, 1, thisID, userName);

            if (listImages == null)
            {
                listImages = new List <UploadPictureAssetModel>();
                for (int i = 0; i < 3; i++)
                {
                    UploadPictureAssetModel image = new UploadPictureAssetModel();
                    image.appraisal_assets_id = thisID;
                    listImages.Add(image);
                }
            }
            return(View(listImages));
        }
Beispiel #2
0
        public ActionResult ManageAssetMap(string appraisalID, string appraisalManageType)//แผนที่
        {
            int thisID = Convert.ToInt32(ContentHelpers.Decode(appraisalID));

            getAppraisalAssetCode(thisID);
            string thisManageType = ContentHelpers.Decode(appraisalManageType);

            TempData["appraisalManageType"] = appraisalManageType != string.Empty ? ContentHelpers.Decode(appraisalManageType) : "";

            string        userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
            MapAssetModel model    = new MapAssetModel();

            List <MapAssetModel> listMap = AppraisalService.GetMapAsset(0, thisID, userName);

            if (listMap != null)
            {
                foreach (MapAssetModel map in listMap)
                {
                    model.map_assets_id = map.map_assets_id;
                    model.latitude      = map.latitude;
                    model.longitude     = map.longitude;
                }
            }
            model.appraisal_assets_id = thisID;

            return(View(model));
        }
Beispiel #3
0
        public ActionResult LockUser(int id, Boolean isLock)
        {
            try
            {
                if (id > 0)
                {
                    string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
                    //string userName = "******";
                    if (MembershipService.LockUser(id, isLock, userName))
                    {
                        return(RedirectToAction("manage", "backend"));
                    }
                    else
                    {
                        ModelState.AddModelError("", "Lock user unsuccess.");
                    }
                }
                else
                {
                    ModelState.AddModelError("", "Not request user id.");
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }

            return(View());
        }
Beispiel #4
0
        public ActionResult Register(RegisterModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
                    //string userName = "******";
                    // Attempt to register the user
                    Hashtable process = MembershipService.CreateUser(model, userName);
                    if (Convert.ToBoolean(process["Status"]))
                    {
                        return(RedirectToAction("manage", "backend"));
                    }
                    else
                    {
                        ModelState.AddModelError("", Convert.ToString(process["Message"]));
                    }
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }

            return(View(model));
        }
Beispiel #5
0
        public ActionResult ManageAssetDoc(AppraisalDetailModel model, string appraisalManageType)//เอกสารสิทธิ์
        {
            try
            {
                TempData["appraisalManageType"] = appraisalManageType != string.Empty ? appraisalManageType : "";
                getAppraisalAssetCode(model.appraisal_assets_id);
                setAssetDoc();

                if (ModelState.IsValid && model.type_of_document_id != 0)
                {
                    string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
                    var    process  = AppraisalService.MngAppraisalDetail(model, userName);
                    if (process)
                    {
                        List <AppraisalDetailModel> modelList = AppraisalService.GetAppraisalDetail(model.assets_detail_id, model.appraisal_assets_id, userName);
                        if (ContentHelpers.IsNotnull(modelList) && modelList.Count > 0)
                        {
                            model = modelList[0];

                            string _appraisalManageType = ContentHelpers.Decode(appraisalManageType);
                            string thisManageType       = _appraisalManageType;
                            if (_appraisalManageType != "u")
                            {
                                appraisalManageType = ContentHelpers.Encode(appraisalManageType);
                            }

                            return(RedirectToAction(
                                       "ManageAssetDocPic",
                                       new RouteValueDictionary(new
                            {
                                appraisalID = ContentHelpers.Encode(model.appraisal_assets_id.ToString()),
                                appraisalManageType = appraisalManageType
                            })
                                       ));
                        }
                    }
                    else
                    {
                        ViewData["alert"] = ContentHelpers.getAlertBox(DataInfo.AlertStatusId.ERROR, "จัดการข้อมูลไม่สำเร็จ!");
                    }
                }
                else
                {
                    if (model.type_of_document_id == 0)
                    {
                        ViewData["type_of_document_id"] = "false";
                    }
                }
            }
            catch (ArgumentException ae)
            {
                ModelState.AddModelError(String.Empty, ae.Message);
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }

            return(View(model));
        }
Beispiel #6
0
        public ActionResult ManageAssetDetail(string appraisalID, string appraisalManageType) //ข้อมูลที่ตั้งทรัพย์สิน
        {
            setAssetDetail();                                                                 //ระบุ filter ในหน้า View

            string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));

            TempData["appraisalManageType"] = appraisalManageType != string.Empty ? ContentHelpers.Decode(appraisalManageType) : "";

            int thisID = appraisalID != null?Convert.ToInt32(ContentHelpers.Decode(appraisalID)) : 0;

            if (string.IsNullOrEmpty(appraisalManageType))
            {
                //string thisManageType = ContentHelpers.Decode(appraisalManageType);

                AppraisalJobModel Model = LoadAssetDetail(thisID, userName);

                //ระบุ id user, job code, ความสามารถ update/view ของ user ลง Tempdata
                setManageDetail(Model.appraisal_assets_id, appraisalManageType);

                return(View(Model));
            }
            else
            {
                if (thisID > 0)
                {
                    TempData["appraisalManageType"] = "u";
                }
            }

            return(View());
        }
Beispiel #7
0
        public ActionResult ManageOtherDetail(List <CompareDescriptionModel> modelList, string appraisalManageType)//รายละเอียดเพิ่มเติม
        {
            try
            {
                TempData["appraisalManageType"] = appraisalManageType != string.Empty ? appraisalManageType : "";
                getAppraisalAssetCode(modelList[0].appraisal_assets_id);

                if (ModelState.IsValid)
                {
                    string userName         = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
                    bool   process          = false;
                    int    appraisalAssetId = 0;
                    foreach (var model in modelList)
                    {
                        appraisalAssetId = model.appraisal_assets_id;
                        process          = AppraisalService.MngCompareDescription(model);
                    }

                    if (process)
                    {
                        if (appraisalAssetId > 0)
                        {
                            modelList = AppraisalService.GetCompareDescription(0, appraisalAssetId, userName);

                            string _appraisalManageType = ContentHelpers.Decode(appraisalManageType);
                            string thisManageType       = _appraisalManageType;
                            if (_appraisalManageType != "u")
                            {
                                appraisalManageType = ContentHelpers.Encode(appraisalManageType);
                            }

                            return(RedirectToAction(
                                       "ManagePrice",
                                       new RouteValueDictionary(new
                            {
                                appraisalID = ContentHelpers.Encode(appraisalAssetId.ToString()),
                                appraisalManageType = appraisalManageType
                            })
                                       ));
                        }
                    }
                    else
                    {
                        ViewData["alert"] = ContentHelpers.getAlertBox(DataInfo.AlertStatusId.ERROR, "จัดการข้อมูลไม่สำเร็จ!");
                    }
                }
            }
            catch (ArgumentException ae)
            {
                ModelState.AddModelError(String.Empty, ae.Message);
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }
            return(View(modelList));
        }
Beispiel #8
0
        public void getAppraisalAssetCode(int appraisalAssetID)
        {
            string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
            List <AppraisalJobModel> listJob = AppraisalService.GetAppraisalJob(appraisalAssetID, null, userName);

            foreach (AppraisalJobModel model in listJob)
            {
                TempData["appraisalAssetCode"] = model.appraisal_assets_code;
            }
        }
Beispiel #9
0
        // **************************************
        // URL: /Account/LogOff
        // **************************************

        public ActionResult LogOff()
        {
            string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));

            if (Request.IsAuthenticated)
            {
                FormsService.SignOut(userName);
            }
            return(RedirectToAction("LogOn", "Account"));
        }
Beispiel #10
0
        public ActionResult ManageMaterial(LocationAssetModel model, string appraisalManageType)//สิ่งปลูกสร้าง
        {
            try
            {
                TempData["appraisalManageType"] = appraisalManageType != string.Empty ? appraisalManageType : "";
                getAppraisalAssetCode(model.appraisal_assets_id);
                setMaterial();

                if (ModelState.IsValid)
                {
                    string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
                    var    process  = AppraisalService.MngLocationAsset(model, userName);
                    if (process)
                    {
                        List <LocationAssetModel> modelList = AppraisalService.GetLocationAsset(0, model.appraisal_assets_id, userName);
                        if (ContentHelpers.IsNotnull(modelList) && modelList.Count > 0)
                        {
                            model = modelList[0];

                            string _appraisalManageType = ContentHelpers.Decode(appraisalManageType);
                            string thisManageType       = _appraisalManageType;
                            if (_appraisalManageType != "u")
                            {
                                appraisalManageType = ContentHelpers.Encode(appraisalManageType);
                            }

                            return(RedirectToAction(
                                       "ManageCompareAsset",
                                       new RouteValueDictionary(new
                            {
                                appraisalID = ContentHelpers.Encode(model.appraisal_assets_id.ToString()),
                                appraisalManageType = appraisalManageType
                            })
                                       ));
                        }
                    }
                    else
                    {
                        ViewData["alert"] = ContentHelpers.getAlertBox(DataInfo.AlertStatusId.ERROR, "จัดการข้อมูลไม่สำเร็จ!");
                    }
                }
            }
            catch (ArgumentException ae)
            {
                ModelState.AddModelError(String.Empty, ae.Message);
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }
            return(View(model));
        }
Beispiel #11
0
        protected void Session_End(object sender, EventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("Session_End");
            string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));

            if (!string.IsNullOrEmpty(userName))
            {
                AccountController accountControl = new AccountController();
                accountControl.SessionLogOff(userName);
            }
            Session.Abandon();
            Session.Clear();
        }
Beispiel #12
0
        public ActionResult ManageAssetDetail(AppraisalJobModel model, string appraisalManageType)//ข้อมูลที่ตั้งทรัพย์สิน
        {
            try
            {
                TempData["appraisalManageType"] = appraisalManageType != string.Empty ? appraisalManageType : "";
                if (ModelState.IsValid)
                {
                    string    userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
                    Hashtable process  = AppraisalService.MngAppraisalJob(model, userName);

                    if (Convert.ToBoolean(process["Status"]))
                    {
                        if (process["appraisalID"] != null)
                        {
                            string _appraisalManageType = ContentHelpers.Decode(appraisalManageType);
                            string thisManageType       = _appraisalManageType;
                            if (_appraisalManageType != "u")
                            {
                                appraisalManageType = ContentHelpers.Encode(appraisalManageType);
                            }

                            //ระบุ id user, job code, ความสามารถ update/view ของ user ลง Tempdata
                            setManageDetail(Convert.ToInt32(process["appraisalID"]), appraisalManageType);

                            return(RedirectToAction(
                                       "ManageAssetMap",
                                       new RouteValueDictionary(new
                            {
                                appraisalID = ContentHelpers.Encode(process["appraisalID"].ToString()),
                                appraisalManageType = appraisalManageType
                            })
                                       ));
                        }
                    }
                    else
                    {
                        TempData["AppraisalManageType"] = appraisalManageType;
                        ViewData["alert"] = ContentHelpers.getAlertBox(DataInfo.AlertStatusId.ERROR, "จัดการข้อมูลไม่สำเร็จ!");
                    }
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }

            setAssetDetail();

            return(View());
        }
Beispiel #13
0
        public Boolean removeImgDB(int imageAssetId)
        {
            Boolean result   = false;
            string  userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
            List <UploadPictureAssetModel> listImages = AppraisalService.GetUploadPictureAsset(imageAssetId, 0, 0, userName);

            foreach (UploadPictureAssetModel model in listImages)
            {
                model.image_path = null;
                model.file_name  = null;
                result           = AppraisalService.MngUploadPicture(model, userName);
            }

            return(result);
        }
Beispiel #14
0
        public ActionResult ManageCompareAsset(string appraisalID, string appraisalManageType)//ตารางเปรียบเทียบ
        {
            List <CompareAssetModel> modelList = new List <CompareAssetModel>();
            // TempData["AppraisalCode"] = Convert.ToInt32(TempData["AppraisalCode"]);

            int thisID = Convert.ToInt32(ContentHelpers.Decode(appraisalID));

            getAppraisalAssetCode(thisID);
            string thisManageType = ContentHelpers.Decode(appraisalManageType);

            TempData["appraisalManageType"] = appraisalManageType != string.Empty ? ContentHelpers.Decode(appraisalManageType) : "";


            try
            {
                setCompareAsset();

                /* if (ContentHelpers.IsNotnull(thisID) && Convert.ToInt32(thisID) > 0)
                 * {
                 *   modelList = AppraisalService.GetCompareAsset(0, thisID, "");
                 * }
                 * else
                 * {*/
                modelList = AppraisalService.GetCompareAsset(0, thisID, "");
                if (modelList == null)
                {
                    modelList = new List <CompareAssetModel>();
                    for (int i = 1; i < 5; i++)
                    {
                        CompareAssetModel compare = new CompareAssetModel();
                        compare.appraisal_assets_id = thisID;
                        compare.sequence            = i;
                        modelList.Add(compare);
                    }
                }
                //}
            }
            catch (ArgumentException ae)
            {
                ModelState.AddModelError(String.Empty, ae.Message);
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }
            return(View(modelList));
        }
Beispiel #15
0
        public ActionResult ManageOtherDetail(string appraisalID, string appraisalManageType)//รายละเอียดเพิ่มเติม
        {
            List <CompareDescriptionModel> modelList = new List <CompareDescriptionModel>();

            // TempData["AppraisalCode"] = Convert.ToInt32(TempData["AppraisalCode"]);

            int thisID = Convert.ToInt32(ContentHelpers.Decode(appraisalID));

            getAppraisalAssetCode(thisID);
            string thisManageType = ContentHelpers.Decode(appraisalManageType);

            TempData["appraisalManageType"] = appraisalManageType != string.Empty ? ContentHelpers.Decode(appraisalManageType) : "";

            try
            {
                if (ContentHelpers.IsNotnull(thisID) && thisID > 0)
                {
                    modelList = AppraisalService.GetCompareDescription(0, thisID, "");
                }
                else
                {
                    if (modelList == null)
                    {
                        modelList = new List <CompareDescriptionModel>();
                        for (int i = 1; i < 5; i++)
                        {
                            CompareDescriptionModel compareDesc = new CompareDescriptionModel();
                            compareDesc.appraisal_assets_id = thisID;
                            compareDesc.sequence            = i;
                            modelList.Add(compareDesc);
                        }
                    }
                }
            }
            catch (ArgumentException ae)
            {
                ModelState.AddModelError(String.Empty, ae.Message);
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }
            return(View(modelList));
        }
Beispiel #16
0
        public ActionResult ManageAssetMap(MapAssetModel model, string appraisalManageType)//แผนที่
        {
            try
            {
                TempData["appraisalManageType"] = appraisalManageType != string.Empty ? appraisalManageType : "";
                getAppraisalAssetCode(model.appraisal_assets_id);

                if (ModelState.IsValid)
                {
                    string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
                    // Attempt to register the user
                    Boolean process = AppraisalService.MngMapAsset(model, userName);
                    if (Convert.ToBoolean(process))
                    {
                        string _appraisalManageType = ContentHelpers.Decode(appraisalManageType);
                        string thisManageType       = _appraisalManageType;
                        if (_appraisalManageType != "u")
                        {
                            appraisalManageType = ContentHelpers.Encode(appraisalManageType);
                        }

                        return(RedirectToAction(
                                   "ManageAssetDoc",
                                   new RouteValueDictionary(new
                        {
                            appraisalID = ContentHelpers.Encode(model.appraisal_assets_id.ToString()),
                            appraisalManageType = appraisalManageType
                        })
                                   ));
                    }
                    else
                    {
                        ViewData["alert"] = ContentHelpers.getAlertBox(DataInfo.AlertStatusId.ERROR, "จัดการข้อมูลไม่สำเร็จ!");
                    }
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }
            getAppraisalAssetCode(model.appraisal_assets_id);
            return(View());
        }
Beispiel #17
0
        public List <AppraisalListsModel> searchResult(FormCollection val)
        {
            List <AppraisalListsModel> searchList = new List <AppraisalListsModel>();

            string appraisalCode = val["appraisalCode"];
            int    districtId    = val["districtId"] == null ? 38 : Convert.ToInt32(val["districtId"]);
            int    amphurId      = val["amphurId"] == null ? 581 : Convert.ToInt32(val["amphurId"]);
            string userName      = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));

            AppraisalService serv = new AppraisalService();

            searchList = serv.GetAppraisalLists(appraisalCode, districtId, amphurId, userName, true);
            if (ContentHelpers.Isnull(searchList) || searchList.Count <= 0)
            {
                ModelState.AddModelError("", "Search data not found.");
            }

            return(searchList);
        }
Beispiel #18
0
        public ActionResult ManagePrice(string appraisalID, string appraisalManageType)//สรุปราคา
        {
            int thisID = Convert.ToInt32(ContentHelpers.Decode(appraisalID));

            getAppraisalAssetCode(thisID);
            string thisManageType = ContentHelpers.Decode(appraisalManageType);

            TempData["appraisalManageType"] = appraisalManageType != string.Empty ? ContentHelpers.Decode(appraisalManageType) : "";

            string           userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
            ManagePriceModel model    = new ManagePriceModel();

            List <ManagePriceModel> listPrice = AppraisalService.GetManagePrice(thisID);

            if (listPrice != null)
            {
                foreach (ManagePriceModel price in listPrice)
                {
                    model.appraisal_assets_id   = price.appraisal_assets_id;
                    model.appraisal_assets_code = price.appraisal_assets_code;
                    model.village            = price.village;
                    model.alley              = price.alley;
                    model.road               = price.road;
                    model.district_name      = price.district_name;
                    model.amphur_name        = price.amphur_name;
                    model.province_name      = price.province_name;
                    model.detailed_location  = price.detailed_location;
                    model.asset_type         = price.asset_type;
                    model.assessment_methods = price.assessment_methods;
                    model.rights_of_access   = price.rights_of_access;
                    model.paint_the_town     = price.paint_the_town;
                    model.land_value         = price.land_value;
                    model.building_value     = price.building_value;
                }
            }
            else
            {
                model.appraisal_assets_id = thisID;
            }

            return(View(model));
        }
Beispiel #19
0
        public ActionResult GetUserList(string keyword)
        {
            try
            {
                string           userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
                List <UserModel> userList = MembershipService.GetUsers(keyword);
                if (ContentHelpers.IsNotnull(userList) && userList.Count > 0)
                {
                    ViewData["UserList"] = userList;
                }
                else
                {
                    ModelState.AddModelError("", "Search data not found.");
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }

            return(View());
        }
Beispiel #20
0
        public ActionResult ManageAssetDoc(string appraisalID, string appraisalManageType)//เอกสารสิทธิ์
        {
            AppraisalDetailModel model = new AppraisalDetailModel();
            //model.appraisal_assets_id = Convert.ToInt32(TempData["AppraisalID"]);
            //TempData["AppraisalCode"] = Convert.ToInt32(TempData["AppraisalCode"]);

            int thisID = Convert.ToInt32(ContentHelpers.Decode(appraisalID));

            model.appraisal_assets_id = thisID;
            getAppraisalAssetCode(thisID);
            string thisManageType = ContentHelpers.Decode(appraisalManageType);

            TempData["appraisalManageType"] = appraisalManageType != string.Empty ? ContentHelpers.Decode(appraisalManageType) : "";

            try
            {
                setAssetDoc();

                if (ContentHelpers.IsNotnull(thisID) && thisID > 0)
                {
                    List <AppraisalDetailModel> modelList = AppraisalService.GetAppraisalDetail(0, thisID, "");
                    if (ContentHelpers.IsNotnull(modelList) && modelList.Count > 0)
                    {
                        model = modelList[0];
                    }
                }
            }
            catch (ArgumentException ae)
            {
                ModelState.AddModelError(String.Empty, ae.Message);
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }

            return(View(model));
        }
Beispiel #21
0
        public ActionResult ChangePassword(ChangePasswordModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    string userName = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
                    if (MembershipService.ChangePassword(User.Identity.Name, model.OldPassword, model.NewPassword, userName))
                    {
                        return(RedirectToAction(""));
                    }
                    else
                    {
                        ModelState.AddModelError("", "The current password is incorrect or the new password is invalid.");
                    }
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError(String.Empty, e.Message);
            }

            return(View(model));
        }
Beispiel #22
0
        public ActionResult ManageCompareAssetPic(List <UploadPictureAssetModel> models, HttpPostedFileBase[] MultipleFiles, string appraisalManageType)//รูปข้อมูลเทียบ
        {
            string  userName    = ContentHelpers.Decode(Convert.ToString(Session["UserName"]));
            Boolean process     = true;
            int     count       = 0;
            string  pathPic     = "";
            string  fileName    = "";
            string  savePath    = "";
            int     appraisalID = 0;

            TempData["appraisalManageType"] = appraisalManageType != string.Empty ? appraisalManageType : "";
            getAppraisalAssetCode(models[0].appraisal_assets_id);

            foreach (UploadPictureAssetModel model in models)
            {
                pathPic  = "";
                fileName = "";
                savePath = "";

                appraisalID = model.appraisal_assets_id;
                if (MultipleFiles[count] != null && MultipleFiles[count].ContentLength > 0)
                {
                    try
                    {
                        string path = Server.MapPath("~/Images/Compare/" + model.appraisal_assets_id);

                        fileName = MultipleFiles[count].FileName;
                        if (!Directory.Exists(path))
                        {
                            Directory.CreateDirectory(path);
                        }
                        savePath = Path.Combine(path,
                                                Path.GetFileName(MultipleFiles[count].FileName));
                        MultipleFiles[count].SaveAs(savePath);
                        pathPic = "~/Images/Compare/" + model.appraisal_assets_id + "/" + fileName;
                    }
                    catch (Exception ex)
                    {
                        ModelState.AddModelError(String.Empty, ex.Message);
                    }
                }

                count++;

                if (model.image_assets_id == 0 || pathPic != "")
                {
                    process              = false;
                    model.image_path     = pathPic;
                    model.file_name      = fileName;
                    model.upload_type_id = 3; //รูปภาพเปรียบเทียบ
                    model.sequence       = count;
                    process              = AppraisalService.MngUploadPicture(model, userName);
                }
            }
            if (Convert.ToBoolean(process))
            {
                string _appraisalManageType = ContentHelpers.Decode(appraisalManageType);
                string thisManageType       = _appraisalManageType;
                if (_appraisalManageType != "u")
                {
                    appraisalManageType = ContentHelpers.Encode(appraisalManageType);
                }

                return(RedirectToAction(
                           "ManageOtherDetail",
                           new RouteValueDictionary(new
                {
                    appraisalID = ContentHelpers.Encode(appraisalID.ToString()),
                    appraisalManageType = appraisalManageType
                })
                           ));
            }
            else
            {
                ViewData["alert"] = ContentHelpers.getAlertBox(DataInfo.AlertStatusId.ERROR, "จัดการข้อมูลไม่สำเร็จ!");
            }
            return(View());
        }