Esempio n. 1
0
        public ActionResult btnBasicEdit_Click()
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (BASE_YUZHIBENGZHANDal.Exist(" and FDTUCode='" + Request["tbSelectedDTU"] + "' and FDTUCode<>'" + Request["tbOldDTU"] + "'").Rows.Count == 0)
                    {
                        int       FCustomerID = Convert.ToInt32(Request["tbxCustomerID"]);
                        Hashtable hasData     = new Hashtable();
                        hasData["id"]                 = Request["tbxID"];
                        hasData["FDTUCode"]           = Request["tbSelectedDTU"];
                        hasData["FName"]              = Request["tbxName"];
                        hasData["RunPumpNum"]         = Request["ddlRunPumpNum"];
                        hasData["Auxiliarypumpcount"] = Request["ddlAuxiliarypumpcount"];
                        hasData["DrainPumpNum"]       = Request["ddlDrainPumpNum"];
                        hasData["FTankVolume"]        = Request["txt_sxrj"];//水箱容积
                        hasData["FCustomerID"]        = FCustomerID;
                        hasData["FLngLat"]            = Request["tbxLngLat"];
                        hasData["FMapAddress"]        = Request["tbSelectedAddress"];
                        hasData["FWell"]              = Request["hidFWell"];
                        hasData["FPipeline"]          = Request["hidFPipeline"];
                        hasData["FEnterValve"]        = Request["hidFEnterValve"];
                        hasData["FExitValve"]         = Request["hidFExitValve"];
                        hasData["FBrand"]             = Request["tbxFBrand"];
                        hasData["FMaterial"]          = Request["ddlFMaterial"];
                        hasData["FCaliber"]           = Request["ddlFCaliber"];
                        hasData["FEQuiType"]          = Request["ddlFEQuiType"];
                        hasData["FInstallMode"]       = Request["ddlFInstallMode"];
                        hasData["FCommunicationMode"] = Request["ddlFCommunicationMode"];
                        hasData["FReadMeterMode"]     = Request["ddlFReadMeterMode"];
                        hasData["FBuriedMode"]        = Request["ddlFBuriedMode"];
                        hasData["FEQuiState"]         = Request["ddlFEQuiState"];
                        hasData["FGroundHeigh"]       = Request["tbxFGroundHeigh"];
                        hasData["FNote"]              = Request["tbxFNote"];
                        hasData["FBYCycle"]           = Request["tbxFBYCycle"];
                        hasData["FGHCycle"]           = Request["tbxFGHCycle"];
                        hasData["FSchemeID"]          = Request["tbxFSchemeID"];
                        hasData["FUpdUser"]           = GetIdentityName();
                        hasData["FUpdDate"]           = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        BASE_YUZHIBENGZHANDal.Update(hasData);


                        Hashtable hasData1 = new Hashtable();
                        hasData1["FDTUCode"] = Request["tbSelectedDTU"];
                        hasData1["BASEID"]   = Request["tbxID"];
                        DATA_YUZHIBENGZHAN_MAINDal.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["tbxName"];
                                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());
                    }
                    else
                    {
                        ShowNotify("流量编号重复,请更换!");
                    }
                }
            }
            catch
            {
                ShowNotify("失败!");
            }
            return(UIHelper.Result());
        }
Esempio n. 2
0
        public ActionResult btnBasicCreate_Click()
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (BASE_YUZHIBENGZHANDal.Exist(" and FDTUCode='" + Request["tbSelectedDTU"] + "'").Rows.Count == 0)
                    {
                        string    guid        = Guid.NewGuid().ToString();
                        string    YuZhiPumpid = Guid.NewGuid().ToString();
                        int       FCustomerID = Convert.ToInt32(Request["tbxCustomerID"]);
                        Hashtable hasData     = new Hashtable();
                        hasData["id"]                 = YuZhiPumpid;
                        hasData["FDTUCode"]           = Request["tbSelectedDTU"];
                        hasData["FName"]              = Request["tbxName"];
                        hasData["RunPumpNum"]         = Request["ddlRunPumpNum"];
                        hasData["Auxiliarypumpcount"] = Request["ddlAuxiliarypumpcount"];
                        hasData["DrainPumpNum"]       = Request["ddlDrainPumpNum"];
                        hasData["FTankVolume"]        = Request["txt_sxrj"];//水箱容积
                        hasData["FCustomerID"]        = FCustomerID;
                        hasData["FLngLat"]            = Request["tbxLngLat"];
                        hasData["FMapAddress"]        = Request["tbSelectedAddress"];
                        hasData["FWell"]              = Request["hidFWell"];
                        hasData["FPipeline"]          = Request["hidFPipeline"];
                        hasData["FEnterValve"]        = Request["hidFEnterValve"];
                        hasData["FExitValve"]         = Request["hidFExitValve"];
                        hasData["FBrand"]             = Request["tbxFBrand"];
                        hasData["FMaterial"]          = Request["ddlFMaterial"];
                        hasData["FCaliber"]           = Request["ddlFCaliber"];
                        hasData["FEQuiType"]          = Request["ddlFEQuiType"];
                        hasData["FInstallMode"]       = Request["ddlFInstallMode"];
                        hasData["FCommunicationMode"] = Request["ddlFCommunicationMode"];
                        hasData["FReadMeterMode"]     = Request["ddlFReadMeterMode"];
                        hasData["FBuriedMode"]        = Request["ddlFBuriedMode"];
                        hasData["FEQuiState"]         = Request["ddlFEQuiState"];
                        hasData["FGroundHeigh"]       = Request["tbxFGroundHeigh"];
                        hasData["FBYCycle"]           = Request["tbxFBYCycle"];
                        hasData["FGHCycle"]           = Request["tbxFGHCycle"];
                        hasData["FNote"]              = Request["tbxFNote"];
                        hasData["FSchemeID"]          = Request["tbxFSchemeID"];
                        hasData["FCreateUser"]        = GetIdentityName();
                        hasData["FIsDelete"]          = 0;
                        hasData["FMarkerID"]          = guid;
                        BASE_YUZHIBENGZHANDal.Insert(hasData);

                        Hashtable hasData1 = new Hashtable();
                        hasData1["id"]       = Guid.NewGuid();
                        hasData1["FDTUCode"] = Request["tbSelectedDTU"];
                        hasData1["BASEID"]   = YuZhiPumpid;
                        DATA_YUZHIBENGZHAN_MAINDal.Insert(hasData1);

                        if (FCustomerID > 0)
                        {
                            string[]  lnglat = Request["tbxLngLat"].Split(',');
                            Hashtable has1   = new Hashtable();
                            Hashtable has2   = new Hashtable();
                            has1["ID"]         = guid;
                            has1["FName"]      = Request["tbxName"];
                            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"]      = "11";
                            has2["FMarker"]    = "[{\"lng\":" + lnglat[0] + ",\"lat\":" + lnglat[1] + "}]";
                            has2["FMID"]       = YuZhiPumpid;
                            Bll.Map_MarkerBll.InsertMarker(has1);
                            Bll.Map_MarkerBll.InsertMarkerProperty(has2);
                            Bll.Data_YaLiBll.SearchInsertAlarm(" and FMarkerType=11", guid);
                        }

                        ShowNotify("成功!");
                        string url = Url.Action("YuZhiPump_Diagram", "BASE_YUZHIBENGZHAN", new { type = "edit", YuZhiPumpId = YuZhiPumpid });
                        // 关闭本窗体(触发窗体的关闭事件)'
                        PageContext.RegisterStartupScript("parent.updateLabelResult('" + url + "');");
                    }
                    else
                    {
                        ShowNotify("流量编号重复,请更换!");
                    }
                }
            }
            catch
            {
                ShowNotify("失败!");
            }
            return(UIHelper.Result());
        }