public ActionResult btnBasicEdit_Click() { try { if (ModelState.IsValid) { int FCustomerID = Convert.ToInt32(Request["tbxCustomerID"]); Hashtable hasData = new Hashtable(); hasData["id"] = Request["tbxID"]; hasData["FCustomerID"] = FCustomerID; hasData["FDTUCode"] = Request["tbxFDTUCode"]; hasData["FLngLat"] = Request["tbxLngLat"]; hasData["FMapAddress"] = Request["tbSelectedAddress"]; hasData["FName"] = Request["tbxFName"]; hasData["FBrand"] = Request["tbxFBrand"]; hasData["FMaterial"] = Request["ddlFMaterial"]; hasData["FDeviceType"] = Request["ddlFDeviceType"]; hasData["FOperationMode"] = Request["ddlFOperationMode"]; hasData["FCommunicationMode"] = Request["ddlFCommunicationMode"]; hasData["FCaliber"] = Request["ddlFCaliber"]; hasData["FValveFunction"] = Request["ddlFValveFunction"]; hasData["FDrainageMethod"] = Request["ddlFDrainageMethod"]; hasData["FValveSteering"] = Request["ddlFValveSteering"]; hasData["FBuriedForm"] = Request["ddlFBuriedForm"]; hasData["FGroundElevation"] = Request["tbxFGroundElevation"]; hasData["FWellRoom"] = Request["tbxFWellRoom"]; hasData["FLocationPipeline"] = Request["tbxFLocationPipeline"]; hasData["FEquipmentState"] = Request["ddlFEquipmentState"]; hasData["FBYCycle"] = Convert.ToInt32(Request["tbxFBYCycle"]); hasData["FGHCycle"] = Convert.ToInt32(Request["tbxFGHCycle"]); hasData["FSchemeID"] = Request["tbxFSchemeID"]; //hasData["FNote"] = Convert.ToDateTime(Request["dpInstallDate"].ToString()); hasData["FUpdateUser"] = GetIdentityName(); hasData["FUpdateDate"] = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Base_FamenDal.Update(hasData); Hashtable hasData1 = new Hashtable(); hasData1["FDTUCode"] = Request["tbxFDTUCode"]; hasData1["BASEID"] = Request["tbxID"]; DATA_FAMENDal.Update(hasData1); if (FCustomerID > 0) { if (Request["tbxFMarkerID"].ToString() != "") { string[] lnglat = Request["tbxLngLat"].Split(','); Hashtable has1 = new Hashtable(); has1["ID"] = Request["tbxFMarkerID"]; has1["FName"] = Request["tbxFName"]; has1["FMapTempID"] = Request["tbxFMapTempID"]; Bll.Map_MarkerBll.UpdateMarker(has1); Hashtable has2 = new Hashtable(); has2["FMarkerID"] = Request["tbxFMarkerID"]; has2["FMarker"] = "[{\"lng\":" + lnglat[0] + ",\"lat\":" + lnglat[1] + "}]"; Bll.Map_MarkerBll.UpdateMarkerProperty(has2); } } ShowNotify("成功!"); // 关闭本窗体(触发窗体的关闭事件) PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); return(UIHelper.Result()); } } catch { ShowNotify("失败!"); } return(UIHelper.Result()); }
public ActionResult btnBasicCreate_Click() { try { if (ModelState.IsValid) { if (Base_FamenDal.Exist(" and FDTUCode='" + Request["tbSelectedDTU"] + "'").Rows.Count == 0) { string guid = Guid.NewGuid().ToString(); string famenid = Guid.NewGuid().ToString(); int FCustomerID = Convert.ToInt32(Request["tbxCustomerID"]); Hashtable hasData = new Hashtable(); hasData["id"] = famenid; hasData["FCustomerID"] = FCustomerID; hasData["FDTUCode"] = Request["tbxFDTUCode"]; hasData["FLngLat"] = Request["tbxLngLat"]; hasData["FMapAddress"] = Request["tbSelectedAddress"]; hasData["FName"] = Request["tbxFName"]; hasData["FBrand"] = Request["tbxFBrand"]; hasData["FMaterial"] = Request["ddlFMaterial"]; hasData["FDeviceType"] = Request["ddlFDeviceType"]; hasData["FOperationMode"] = Request["ddlFOperationMode"]; hasData["FCommunicationMode"] = Request["ddlFCommunicationMode"]; hasData["FCaliber"] = Request["ddlFCaliber"]; hasData["FValveFunction"] = Request["ddlFValveFunction"]; hasData["FDrainageMethod"] = Request["ddlFDrainageMethod"]; hasData["FValveSteering"] = Request["ddlFValveSteering"]; hasData["FBuriedForm"] = Request["ddlFBuriedForm"]; hasData["FGroundElevation"] = Request["tbxFGroundElevation"]; hasData["FWellRoom"] = Request["tbxFWellRoom"]; hasData["FLocationPipeline"] = Request["tbxFLocationPipeline"]; hasData["FEquipmentState"] = Request["ddlFEquipmentState"]; hasData["FBYCycle"] = Convert.ToInt32(Request["tbxFBYCycle"]); hasData["FGHCycle"] = Convert.ToInt32(Request["tbxFGHCycle"]); //hasData["FNote"] = Convert.ToDateTime(Request["dpInstallDate"].ToString()); hasData["FCreateDate"] = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); hasData["FCreateUser"] = GetIdentityName(); hasData["FMarkerID"] = guid; hasData["FIsDelete"] = 0; hasData["FSchemeID"] = Request["tbxFSchemeID"]; Base_FamenDal.Insert(hasData); Hashtable hasData1 = new Hashtable(); hasData1["id"] = Guid.NewGuid(); hasData1["FDTUCode"] = Request["tbxFDTUCode"]; hasData1["BASEID"] = famenid; DATA_FAMENDal.Insert(hasData1); if (FCustomerID > 0) { string[] lnglat = Request["tbxLngLat"].Split(','); Hashtable has1 = new Hashtable(); Hashtable has2 = new Hashtable(); has1["ID"] = guid; has1["FName"] = Request["tbxFName"]; has1["FMapTempID"] = Request["tbxFMapTempID"]; has2["FMarkerID"] = guid; int maxid = Convert.ToInt32(Dal.DBUtil.SelectDataTable("select isnull(max(ID),0) as maxId from Map_MarkerProperty").Rows[0]["maxId"].ToString()) + 1; has2["FAliasName"] = "Marker" + maxid.ToString(); has2["FType"] = "2"; has2["FMarker"] = "[{\"lng\":" + lnglat[0] + ",\"lat\":" + lnglat[1] + "}]"; has2["FMID"] = famenid; Bll.Map_MarkerBll.InsertMarker(has1); Bll.Map_MarkerBll.InsertMarkerProperty(has2); } ShowNotify("成功!"); string url = Url.Action("Famen_Diagram", "BASE_FAMEN", new { type = "edit", famenid = famenid }); //return RedirectToAction("Pump_Diagram", "V_BFGL", new { type = "edit", pumpId = 1002 }); // 关闭本窗体(触发窗体的关闭事件)' PageContext.RegisterStartupScript("parent.updateLabelResult('" + url + "');"); } else { ShowNotify("阀门编号重复,请更换!"); } } } catch { ShowNotify("失败!"); } return(UIHelper.Result()); }