//创建发票对象
 public GeneralObject CreateObj(GeneralObject source,double no)
 {
     GeneralObject go = new GeneralObject();
     go.EntityType = EntityType;
     string value = no.ToString();
     if (value.Length != BeginNo.ToString().Length)
     {
         for (int i = 0; i <= BeginNo.ToString().Length-value.Length; i++)
         {
             value = "0" + value;
         }
     }
     //发票号
     go.SetPropertyValue("f_invoicenum", value, true);
     //所属公司
     go.SetPropertyValue("f_filiale", source.GetPropertyValue("f_filiale"), true);
     //发票状态
     go.SetPropertyValue("f_fapiaostatue", "未用", true);
     //使用人
     go.SetPropertyValue("f_sgoperator", source.GetPropertyValue("f_sgoperator"), true);
     //分配人
     go.SetPropertyValue("f_operator", source.GetPropertyValue("f_operator"), true);
     //分配日期
     go.SetPropertyValue("f_date", source.GetPropertyValue("f_date"), true);
     return go;
 }
Esempio n. 2
0
        /**
         * 主工作方法定时得到通道信息
         **/
        void work_Tick(object sender, EventArgs e)
        {
            string    address = this.TelServiceUrl + "/GetLineInfo?lineNum=" + this.LineNum + "&gonghao=" + this.GongHao;
            Uri       uri     = new Uri(address);
            WebClient client  = new WebClient();

            client.DownloadStringCompleted += (o, a) =>
            {
                if (a.Error == null)
                {
                    //更新数据
                    JsonObject items = JsonValue.Parse(a.Result) as JsonObject;
                    items["PhoneState"] = items["State"];
                    items.Remove("State");
                    GeneralObject go = new GeneralObject();
                    go.FromJson(items);
                    if (go == null)
                    {
                        this.PhoneState = GetPropertyValue("14") + "";
                        return;
                    }
                    //设置电话信息
                    string stateIndex = go.GetPropertyValue("PhoneState") + "";
                    //如果状态是接听,并且电话号码和录音号与语音服务部相同,设置
                    this.PhoneState = GetPropertyValue(stateIndex) + "";
                    //如果电话号码相同,不通知
                    string oldNumber = this.CallNumber;
                    if (oldNumber == null)
                    {
                        oldNumber = "";
                    }
                    string newNumber = go.GetPropertyValue("CallerPhone") + "";
                    if (newNumber != null && !newNumber.Equals("") && !oldNumber.Equals(newNumber))
                    {
                        this.CallNumber = newNumber;
                    }
                    //如果记录号不相同,设置
                    string oldRecordFile = this.RecordFile;
                    if (oldRecordFile == null)
                    {
                        oldRecordFile = "";
                    }
                    string newRecordFile = go.GetPropertyValue("RecordFile") + "";
                    if (newRecordFile != null && !newRecordFile.Equals("") && !oldRecordFile.Equals(newRecordFile))
                    {
                        this.RecordFile = newRecordFile;
                    }
                    State = State.Loaded;
                }
                else
                {
                    this.PhoneState = GetPropertyValue("14") + "";
                    State           = State.LoadError;
                    Error           = a.Error.Message;
                }
            };
            //client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
            client.DownloadStringAsync(uri, "");
        }
Esempio n. 3
0
 void MainPage_Loaded(object sender, RoutedEventArgs e)
 {
     Com.Aote.ObjectTools.GeneralObject go = ObjectExtension.FindResource(this, "LoginUser") as Com.Aote.ObjectTools.GeneralObject;
     Com.Aote.ObjectTools.ObjectList    ol = go.GetPropertyValue("functions") as Com.Aote.ObjectTools.ObjectList;
     //CommonList newol = new CommonList();
     foreach (Com.Aote.ObjectTools.GeneralObject item in ol)
     {
         //CommonObject co = new CommonObject();
         //co["name"] = item.GetPropertyValue("name");
         //co["icon"] = item.GetPropertyValue("icon");
         //co["childsShow"] = "Collapsed";
         item.SetPropertyValue("childsShow", "Collapsed", true);
         //CommonList newchildlist = new CommonList();
         //Com.Aote.ObjectTools.ObjectList childlist = item.GetPropertyValue("children") as Com.Aote.ObjectTools.ObjectList;
         //foreach (Com.Aote.ObjectTools.GeneralObject child in childlist)
         //{
         //CommonObject newchild = new CommonObject();
         //newchild["name"] = child.GetPropertyValue("name");
         //newchild["link"] = child.GetPropertyValue("link");
         //newchildlist.Add(newchild);
         //}
         //co["children"] = newchildlist;
         //newol.Add(co);
     }
     this.menus.ItemsSource = ol;
 }
Esempio n. 4
0
        /// <summary>
        /// 重载对象相等方法,两个对象只要id号相同则相等。如果其中一个没有id号,则不相等。如果都没有id号,那么
        /// 只有引用相等时才相等。
        /// </summary>
        /// <param name="obj">要比较的对象</param>
        /// <returns>是否相等</returns>
        public override bool Equals(object obj)
        {
            //如果类型不同,或者对象为空,一定不相等
            if (obj == null || !(obj is GeneralObject))
            {
                return(false);
            }
            GeneralObject go      = obj as GeneralObject;
            object        thisId  = GetPropertyValue("id");
            object        otherId = go.GetPropertyValue("id");

            //如果两个都没有id号或者都没有实体类型,看引用相等否
            if ((thisId == null && otherId == null) || (EntityType == null && go.EntityType == null))
            {
                return(base.Equals(obj));
            }
            //如果其中有一个id或者实体类型为空,一定不相等
            if (thisId == null || otherId == null || EntityType == null || go.EntityType == null)
            {
                return(false);
            }
            //看Id以及实体类型是否相等
            bool result = thisId.ToString().Equals(otherId.ToString()) && this.EntityType.Equals(go.EntityType);

            return(result);
        }
Esempio n. 5
0
 void ReadCard_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
 {
     IsBusy = false;
     //通讯错误
     if (e.Error != null)
     {
         Error = "通讯错误:" + e.Error.Message;
         State = State.LoadError;
     }
     else
     {
         //更新数据
         JsonObject    item = JsonValue.Parse(e.Result) as JsonObject;
         GeneralObject go   = new GeneralObject();
         go.FromJson(item);
         string exception = (string)go.GetPropertyValue("Exception");
         string err       = (string)go.GetPropertyValue("Err");
         //如果后台有异常
         if (exception != null)
         {
             Error = "系统异常:" + exception;
             State = State.LoadError;
         }
         //读卡错误
         else if (err != null)
         {
             Error = "读卡错误:" + err;
             State = State.LoadError;
         }
         else
         {
             //获取卡上内容
             Factory  = (string)go.GetPropertyValue("Factory");
             CardId   = (string)go.GetPropertyValue("CardID");
             Gas      = double.Parse(go.GetPropertyValue("Gas").ToString());
             Money    = double.Parse(go.GetPropertyValue("Money").ToString());
             BuyTimes = int.Parse(go.GetPropertyValue("Times").ToString());
             Bkcs     = int.Parse(go.GetPropertyValue("RenewTimes").ToString());
             Dqdm     = (string)go.GetPropertyValue("Dqdm");
             State    = State.Loaded;
         }
     }
     //通知读卡完成
     OnReadCompleted(null);
 }
Esempio n. 6
0
        //所有写卡结束后的统一处理过程
        void WriteCard_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
        {
            (sender as WebClient).UploadStringCompleted -= WriteCard_UploadStringCompleted;

            IsBusy = false;
            //通讯错误
            if (e.Error != null)
            {
                Error = "通讯错误:" + e.Error.Message;
                State = State.LoadError;
            }
            else
            {
                //更新数据
                JsonObject    item = JsonValue.Parse(e.Result) as JsonObject;
                GeneralObject go   = new GeneralObject();
                go.FromJson(item);
                string exception = (string)go.GetPropertyValue("Exception");
                string err       = (string)go.GetPropertyValue("Err");
                //如果后台有异常
                if (exception != null)
                {
                    Error = "系统异常:" + exception;
                    State = State.LoadError;
                }
                //写卡错误
                else if (err != null)
                {
                    Error = "写卡错误:" + err;
                    State = State.LoadError;
                }
                else
                {
                    Kmm   = (string)go.GetPropertyValue("Kmm");
                    State = State.End;
                }
            }
            OnCompleted(null);
        }
Esempio n. 7
0
        /// <summary>
        /// 根据模板复制对象
        /// </summary>
        /// <param name="tobj">模板对象</param>
        /// <param name="source">数据源对象</param>

        public void CopyFromTemple(GeneralObject tobj, GeneralObject source)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>(tobj._customPropertyValues);

            foreach (KeyValuePair <string, object> item in dic)
            {
                object value = source.GetPropertyValue(item.Key);
                SetPropertyValue(item.Key, value, true);
            }            /*
                          * foreach (KeyValuePair<string, object> item in tobj._customPropertyValues)
                          * {
                          * object value = source.GetPropertyValue(item.Value + "");
                          * SetPropertyValue(item.Key, value, true);
                          * }*/
        }
Esempio n. 8
0
        public void OpenOrClose_(GeneralObject go, string name)
        {
            // 在打开列表里,为打开状态,否则,为关闭状态
            int index = opened.IndexOf(go);

            // 没打开
            if (index == -1)
            {
                // 把该项内容加载到打开列表里
                opened.Add(go);
                // 把当前选中项的属性值,放到selectedValue中,以便产生SQL语句时用
                string value = go.GetPropertyValue(name).ToString();
                this.selectedValues.Add(value);
                // 改变级别
                this.Level = opened.Count;
                // 加载数据,加载以后,要把前几个级别的数据添加进去
                this.DataLoaded += new System.ComponentModel.AsyncCompletedEventHandler(GroupList_DataLoaded);
                this.Load();
            }
        }
 //所有写卡结束后的统一处理过程
 void WriteCard_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
 {
     IsBusy = false;
     //通讯错误
     if (e.Error != null)
     {
         Error = "通讯错误:" + e.Error.Message;
         State = State.LoadError;
     }
     else
     {
         //更新数据
         JsonObject item = JsonValue.Parse(e.Result) as JsonObject;
         GeneralObject go = new GeneralObject();
         go.FromJson(item);
         string exception = (string)go.GetPropertyValue("Exception");
         string err = (string)go.GetPropertyValue("Err");
         //如果后台有异常
         if (exception != null)
         {
             Error = "系统异常:" + exception;
             State = State.LoadError;
         }
         //写卡错误
         else if (err != null)
         {
             Error = "写卡错误:" + err;
             State = State.LoadError;
         }
         else
         {
             Kmm = (string)go.GetPropertyValue("Kmm");
             State = State.End;
         }
     }
     OnCompleted(null);
 }
 void ReadCard_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
 {
     IsBusy = false;
     //通讯错误
     if (e.Error != null)
     {
         Error = "通讯错误:" + e.Error.Message;
         State = State.LoadError;
     }
     else
     {
         //更新数据
         JsonObject item = JsonValue.Parse(e.Result) as JsonObject;
         GeneralObject go = new GeneralObject();
         go.FromJson(item);
         string exception = (string)go.GetPropertyValue("Exception");
         string err = (string)go.GetPropertyValue("Err");
         //如果后台有异常
         if (exception != null)
         {
             Error = "系统异常:" + exception;
             State = State.LoadError;
         }
         //读卡错误
         else if (err != null)
         {
             Error = "读卡错误:" + err;
             State = State.LoadError;
         }
         else
         {
             //获取卡上内容
             Factory = (string)go.GetPropertyValue("Factory");
             CardId = (string)go.GetPropertyValue("CardID");
             Gas = double.Parse(go.GetPropertyValue("Gas").ToString()) ;
             Money = double.Parse(go.GetPropertyValue("Money").ToString());
             BuyTimes = int.Parse(go.GetPropertyValue("Times").ToString());
             Bkcs = int.Parse(go.GetPropertyValue("RenewTimes").ToString());
             Dqdm = (string)go.GetPropertyValue("Dqdm");
             State = State.Loaded;
         }
     }
     //通知读卡完成
     OnReadCompleted(null);
 }
        private void PostUITask(GeneralObject go)
        {
            if (go.GetPropertyValue("CONDITION").ToString().Equals("正常"))
            {
                //供暖方式
                ObjectCollection oc = this.Resources["WARM"] as ObjectCollection;
                bool found = false;
                foreach (Pair pair in oc)
                {
                    if (pair.CName.Equals(go.GetPropertyValue("WARM").ToString()))
                    {
                        found = true;
                        WARM.SelectedItem = pair;
                    }
                }
                if (!found)
                {
                    WARM_OTHER.Text = go.GetPropertyValue("WARM").ToString();
                    WARM.SelectedIndex = oc.Count - 1;
                }

                //基表厂家型号
                oc = this.Resources["JB_METER_NAME"] as ObjectCollection;
                found = false;
                foreach (Pair pair in oc)
                {
                    if (pair.CName.Equals(go.GetPropertyValue("JB_METER_NAME").ToString()))
                    {
                        JB_METER_NAME.SelectedItem = pair;
                        found = true;
                    }
                }
                if (!found)
                {
                    JB_METER_NAME_OTHER.Text = go.GetPropertyValue("JB_METER_NAME").ToString();
                    JB_METER_NAME.SelectedIndex = oc.Count - 1;
                }

                //IC卡表厂家型号
                oc = this.Resources["IC_METER_NAME"] as ObjectCollection;
                found = false;
                foreach (Pair pair in oc)
                {
                    if (pair.CName.Equals(go.GetPropertyValue("IC_METER_NAME").ToString()))
                    {
                        found = true;
                        IC_METER_NAME.SelectedItem = pair;
                    }
                }
                if (!found)
                {
                    IC_METER_NAME_OTHER.Text = go.GetPropertyValue("IC_METER_NAME").ToString();
                    go.SetPropertyValue("IC_METER_NAME", (oc.ElementAt(oc.Count - 1) as Pair).Code, true, true);
                    IC_METER_NAME.SelectedIndex = oc.Count - 1;
                }

                ObjectList lines = go.GetPropertyValue("LINES") as ObjectList;
                //不存在隐患
                if (lines == null)
                    return;

                foreach (GeneralObject line in lines)
                {
                    String EQUIPMENT = line.GetPropertyValue("EQUIPMENT") as string;
                    String CONTENT = line.GetPropertyValue("CONTENT") as string;
                    if (EQUIPMENT.Equals("安全隐患"))
                        CheckCheckBox(CONTENT, precautionCheckPane);
                    else if (EQUIPMENT.Equals("燃气表"))
                        CheckCheckBox(CONTENT, MeterDefectsPane);
                    else if (EQUIPMENT.Equals("立管"))
                        CheckPlumbingBox(CONTENT, PlumbingDefectsPane);
                    else if (EQUIPMENT.Equals("阀门表前阀"))
                        CheckCheckBox(CONTENT, PlumbingMeterValvePane);
                    else if (EQUIPMENT.Equals("阀门灶前阀"))
                        CheckCheckBox(CONTENT, PlumbingCookerValvePane);
                    else if (EQUIPMENT.Equals("阀门自闭阀"))
                        CheckCheckBox(CONTENT, PlumbingAutomaticValvePane);
                    else if (EQUIPMENT.Equals("户内管"))
                        CheckCheckBox(CONTENT, PlumbingPipePane);
                    else if (EQUIPMENT.Equals("灶具软管"))
                        CheckCheckBox(CONTENT, CookerPipePane);
                    else if (EQUIPMENT.Equals("热水器软管"))
                        CheckCheckBox(CONTENT, BoilerPipePane);
                    else if (EQUIPMENT.Equals("热水器安全隐患"))
                        CheckCheckBox(CONTENT, BoilerDefectsPane);
                    else if (EQUIPMENT.Equals("壁挂锅炉安全隐患"))
                        CheckCheckBox(CONTENT, WHEDefectsPane);
                }

                //提取用户档案地址
                String card_id = go.GetPropertyValue("CARD_ID") as string;
                if (IsNullOrEmpty(card_id))
                    return;
                WebClient wc = new WebClient();
                wc.DownloadStringCompleted += wc_GetUserProfileCompleted;
                wc.DownloadStringAsync(new Uri(go.WebClientInfo.BaseAddress + "/one/from T_IC_USERFILE where CARD_ID='" + card_id + "'"));
                //提取可能的维修结果
                String id = go.GetPropertyValue("id") as string;
                if (IsNullOrEmpty(id))
                    return;
                WebClient wc1 = new WebClient();
                wc1.DownloadStringCompleted += wc1_GetUserProfileCompleted;
                wc1.DownloadStringAsync(new Uri(go.WebClientInfo.BaseAddress + "/from T_REPAIR_RESULT where INSPECTION_ID='" + id + "'"));
            }
        }
 private GeneralObject CreateALine(GeneralObject go)
 {
     GeneralObject me = new GeneralObject();
     me.EntityType = "T_INSPECTION_LINE";
     me.SetPropertyValue("CARD_ID", go.GetPropertyValue("CARD_ID"), true);
     me.SetPropertyValue("USER_NAME", go.GetPropertyValue("USER_NAME"), true);
     me.SetPropertyValue("ROAD", go.GetPropertyValue("ROAD"), true);
     me.SetPropertyValue("UNIT_NAME", go.GetPropertyValue("UNIT_NAME"), true);
     me.SetPropertyValue("CUS_DOM", go.GetPropertyValue("CUS_DOM"), true);
     me.SetPropertyValue("CUS_DY", go.GetPropertyValue("CUS_DY"), true);
     me.SetPropertyValue("CUS_FLOOR", go.GetPropertyValue("CUS_FLOOR"), true);
     me.SetPropertyValue("CUS_ROOM", go.GetPropertyValue("CUS_ROOM"), true);
     me.SetPropertyValue("TELPHONE", go.GetPropertyValue("TELPHONE"), true);
     me.SetPropertyValue("SAVE_PEOPLE", go.GetPropertyValue("SAVE_PEOPLE"), true);
     me.SetPropertyValue("SAVE_DATE", go.GetPropertyValue("SAVE_DATE"), true);
     me.SetPropertyValue("IC_METER_NAME", go.GetPropertyValue("IC_METER_NAME"), true);
     me.SetPropertyValue("JB_METER_NAME", go.GetPropertyValue("JB_METER_NAME"), true);
     me.SetPropertyValue("JB_NUMBER", go.GetPropertyValue("JB_NUMBER"), true);
     me.SetPropertyValue("SURPLUS_GAS", go.GetPropertyValue("SURPLUS_GAS"), true);
     return me;
 }
        private bool TransformBeforeSave(GeneralObject go)
        {
            if (!go.GetPropertyValue("CONDITION").Equals("正常"))
                return true;
            //必须输入字段
            if (go.GetPropertyValue("CARD_ID").ToString().Length == 0)
            {
                MessageBox.Show("卡号不能为空!");
                return false;
            }
            if (go.GetPropertyValue("USER_NAME").ToString().Length == 0)
            {
                MessageBox.Show("用户名不能为空!");
                return false;
            }
            if (go.GetPropertyValue("TELPHONE").ToString().Length == 0)
            {
                MessageBox.Show("电话号码不能为空!");
                return false;
            }
            if (go.GetPropertyValue("JB_NUMBER").ToString().Length == 0)
            {
                MessageBox.Show("基表读数不能为空!");
                return false;
            }
            //供暖方式
            if (!CheckCombo(go, WARM, WARM_OTHER, "WARM", "请检查供暖方式!"))
                return false;
            //基表厂家型号
            if (!CheckCombo(go, JB_METER_NAME, JB_METER_NAME_OTHER, "JB_METER_NAME", "请检查基表厂家型号!"))
                return false;
            //IC卡表厂家型号
            if (!CheckCombo(go, IC_METER_NAME, IC_METER_NAME_OTHER, "IC_METER_NAME", "请检查IC卡表厂家型号!"))
                return false;
            if (NEEDS_REPAIR.IsChecked.Value && cmbRepair.SelectedItem == null)
            {
                MessageBox.Show("请选择维修人!");
                return false;
            }
            if (NEEDS_REPAIR.IsChecked.Value)
            {
                go.SetPropertyValue("NEEDS_REPAIR", "是", true);
                GeneralObject mechanic = cmbRepair.SelectedItem as GeneralObject;
                go.SetPropertyValue("REPAIRMAN", mechanic.GetPropertyValue("REPAIRMAN"), true);
                go.SetPropertyValue("REPAIRMAN_ID", mechanic.GetPropertyValue("REPAIRMAN_ID"), true);
            }
            else
            {
                go.SetPropertyValue("NEEDS_REPAIR", "否", true);
                go.SetPropertyValue("REPAIRMAN", null, true);
                go.SetPropertyValue("REPAIRMAN_ID", null, true);
            }

            ObjectList lines = new ObjectList();
            //燃气表隐患,必选一个,也可多选
            if (!FillPrecautionsAccordingToChoices(MeterDefectsPane, go, lines, true, false, "燃气表"))
                return false;
            go.SetPropertyValue("RQB", RQB.IsChecked.Value?"正常":"不正常", true);
            //立管隐患
            if (!FillPrecautionsAccordingToChoices2(PlumbingDefectsPane, go, lines, true, false, "立管"))
                return false;
            go.SetPropertyValue("STANDPIPE", STANDPIPE.IsChecked.Value ? "正常" : "不正常", true);
            //严密性测试
            if (cbRIGIDITYNormal.IsChecked.Value)
                go.SetPropertyValue("RIGIDITY", "正常", true);
            else
                go.SetPropertyValue("RIGIDITY", "不正常", true);
            if (cbRIGIDITYLeakage.IsChecked.Value)
                go.SetPropertyValue("RIGIDITY", "漏气", true);
            //静止压力
            if (cbPressureAbnormal.IsChecked.Value && cbPressureNormal.IsChecked.Value)
            {
                MessageBox.Show("请检查静止选项!");
                return false;
            }
            if(cbPressureNormal.IsChecked.Value)
                go.SetPropertyValue("STATIC", "正常", true);
            else if (cbPressureAbnormal.IsChecked.Value)
                go.SetPropertyValue("STATIC", "不正常", true);
            else
                go.SetPropertyValue("STATIC", "", true);
            //表前阀
            if (!FillPrecautionsAccordingToChoices(PlumbingMeterValvePane, go, lines, true, false, "阀门表前阀"))
                return false;
            go.SetPropertyValue("TABLE_TAP", TABLE_TAP.IsChecked.Value ? "正常" : "不正常", true);
            //灶前阀
            if (!FillPrecautionsAccordingToChoices(PlumbingCookerValvePane, go, lines, true, true, "阀门灶前阀"))
                return false;
            go.SetPropertyValue("COOK_TAP", COOK_TAP.IsChecked.Value ? "正常" : "不正常", true);
            //自闭阀
            if (!FillPrecautionsAccordingToChoices(PlumbingAutomaticValvePane, go, lines, true, true, "阀门自闭阀"))
                return false;
            go.SetPropertyValue("CLOSE_TAP", CLOSE_TAP.IsChecked.Value ? "正常" : "不正常", true);
            //户内管
            if (!FillPrecautionsAccordingToChoices(PlumbingPipePane, go, lines, true, true, "户内管"))
                return false;
            go.SetPropertyValue("INDOOR", INDOOR.IsChecked.Value ? "正常" : "不正常", true);
            //漏气
            if (cbLEAKAGE_COOKER.IsChecked.Value)
                go.SetPropertyValue("LEAKAGE_COOKER", "灶具漏气", true);
            else
                go.SetPropertyValue("LEAKAGE_COOKER", "", true);
            if (cbLEAKAGE_HEATER.IsChecked.Value)
                go.SetPropertyValue("LEAKAGE_HEATER", "热水器漏气", true);
            else
                go.SetPropertyValue("LEAKAGE_HEATER", "", true);
            if (cbLEAKAGE_BOILER.IsChecked.Value)
                go.SetPropertyValue("LEAKAGE_BOILER", "壁挂炉漏气", true);
            else
                go.SetPropertyValue("LEAKAGE_BOILER", "", true);
            if (cbLEAKAGE_NOTIFIED.IsChecked.Value)
                go.SetPropertyValue("LEAKAGE_NOTIFIED", "安检告知", true);
            else
                go.SetPropertyValue("LEAKAGE_NOTIFIED", "", true);
            //灶具软管
            if (!FillPrecautionsAccordingToChoices(CookerPipePane, go, lines, false, true, "灶具软管"))
                return false;
            go.SetPropertyValue("COOKPIPE_NORMAL", COOKPIPE_NORMAL.IsChecked.Value ? "正常" : "不正常", true);
            //热水器软管
            if (!FillPrecautionsAccordingToChoices(BoilerPipePane, go, lines, false, true, "热水器软管"))
                return false;
            go.SetPropertyValue("WATER_PIPE", WATER_PIPE.IsChecked.Value ? "正常" : "不正常", true);
            //热水器隐患
            if (!FillPrecautionsAccordingToChoices(BoilerDefectsPane, go, lines, false, true, "热水器安全隐患"))
                return false;
            go.SetPropertyValue("WATER_HIDDEN", WATER_HIDDEN.IsChecked.Value ? "正常" : "不正常", true);
            //壁挂锅炉安全隐患
            if (!FillPrecautionsAccordingToChoices(WHEDefectsPane, go, lines, false, true, "壁挂锅炉安全隐患"))
                return false;
            go.SetPropertyValue("WHE_HIDDEN", WHE_HIDDEN.IsChecked.Value ? "正常" : "不正常", true);
            //安全隐患
            if (!FillPrecautionsAccordingToChoices(precautionCheckPane, go, lines, false, false, "安全隐患"))
                return false;

            go.SetPropertyValue("LINES", lines, true);
            return true;
        }
        private void PostUITask(GeneralObject go)
        {
            if (go.GetPropertyValue("CONDITION").ToString().Equals("正常"))
            {
                ////供暖方式
                //ObjectCollection oc = this.Resources["WARM"] as ObjectCollection;
                //bool found = false;
                //foreach (Pair pair in oc)
                //{
                //    if (pair.CName.Equals(go.GetPropertyValue("WARM").ToString()))
                //    {
                //        found = true;
                //        WARM.SelectedItem = pair;
                //    }
                //}
                //if (!found)
                //{
                //    WARM_OTHER.Text = go.GetPropertyValue("WARM").ToString();
                //    WARM.SelectedIndex = oc.Count - 1;
                //}

                ////基表厂家型号
                //oc = this.Resources["JB_METER_NAME"] as ObjectCollection;
                //found = false;
                //foreach (Pair pair in oc)
                //{
                //    if (pair.CName.Equals(go.GetPropertyValue("JB_METER_NAME").ToString()))
                //    {
                //        JB_METER_NAME.SelectedItem = pair;
                //        found = true;
                //    }
                //}
                //if (!found)
                //{
                //    JB_METER_NAME_OTHER.Text = go.GetPropertyValue("JB_METER_NAME").ToString();
                //    JB_METER_NAME.SelectedIndex = oc.Count - 1;
                //}

                ////IC卡表厂家型号
                //oc = this.Resources["IC_METER_NAME"] as ObjectCollection;
                //found = false;
                //foreach (Pair pair in oc)
                //{
                //    if (pair.CName.Equals(go.GetPropertyValue("IC_METER_NAME").ToString()))
                //    {
                //        found = true;
                //        IC_METER_NAME.SelectedItem = pair;
                //    }
                //}
                //if (!found)
                //{
                //    IC_METER_NAME_OTHER.Text = go.GetPropertyValue("IC_METER_NAME").ToString();
                //    go.SetPropertyValue("IC_METER_NAME", (oc.ElementAt(oc.Count - 1) as Pair).Code, true, true);
                //    IC_METER_NAME.SelectedIndex = oc.Count - 1;
                //}

                //ObjectList lines = go.GetPropertyValue("LINES") as ObjectList;
                ////不存在隐患
                //if (lines == null)
                //    return;

                //foreach (GeneralObject line in lines)
                //{
                //    String EQUIPMENT = line.GetPropertyValue("EQUIPMENT") as string;
                //    String CONTENT = line.GetPropertyValue("CONTENT") as string;
                //    if (EQUIPMENT.Equals("安全隐患"))
                //        CheckCheckBox(CONTENT, precautionCheckPane);
                //    else if (EQUIPMENT.Equals("燃气表"))
                //        CheckCheckBox(CONTENT, MeterDefectsPane);
                //    else if (EQUIPMENT.Equals("立管"))
                //        CheckPlumbingBox(CONTENT, PlumbingDefectsPane);
                //    else if (EQUIPMENT.Equals("阀门表前阀"))
                //        CheckCheckBox(CONTENT, PlumbingMeterValvePane);
                //    else if (EQUIPMENT.Equals("阀门灶前阀"))
                //        CheckCheckBox(CONTENT, PlumbingCookerValvePane);
                //    else if (EQUIPMENT.Equals("阀门自闭阀"))
                //        CheckCheckBox(CONTENT, PlumbingAutomaticValvePane);
                //    else if (EQUIPMENT.Equals("户内管"))
                //        CheckCheckBox(CONTENT, PlumbingPipePane);
                //    else if (EQUIPMENT.Equals("灶具软管"))
                //        CheckCheckBox(CONTENT, CookerPipePane);
                //    else if (EQUIPMENT.Equals("热水器软管"))
                //        CheckCheckBox(CONTENT, BoilerPipePane);
                //    else if (EQUIPMENT.Equals("热水器安全隐患"))
                //        CheckCheckBox(CONTENT, BoilerDefectsPane);
                //    else if (EQUIPMENT.Equals("壁挂锅炉安全隐患"))
                //        CheckCheckBox(CONTENT, WHEDefectsPane);
                //}

                //提取用户档案地址
                String user_id = go.GetPropertyValue("f_userid") as string;
                if (IsNullOrEmpty(user_id))
                    return;
                WebClient wc = new WebClient();
                wc.DownloadStringCompleted += wc_GetUserProfileCompleted;
                wc.DownloadStringAsync(new Uri(go.WebClientInfo.BaseAddress + "/one/from t_userfiles where f_userid='" + user_id + "'"));
            }

        }
        private void PostUITask(GeneralObject go)
        {
            if (go.GetPropertyValue("CONDITION").ToString().Equals("正常"))
            {
                //供暖方式
                if (go.GetPropertyValue("WARM").ToString().Equals("热力公司集中供暖") || go.GetPropertyValue("WARM").ToString  ().Equals("小区集中供暖") || go.GetPropertyValue("WARM").ToString().Equals("客户自行供暖") || go.GetPropertyValue("WARM").ToString().Equals("其他供暖"))
                   {
                       this.WARM.Text = go.GetPropertyValue("WARM").ToString();
                   }
                else
                {
                    this.WARM_OTHER.Text = go.GetPropertyValue("WARM").ToString();
                }
                
               //基表厂家型号
                if (go.GetPropertyValue("JB_METER_NAME").ToString().Equals("丹东") || go.GetPropertyValue("JB_METER_NAME").ToString  ().Equals("重检") || go.GetPropertyValue("JB_METER_NAME").ToString().Equals("赛福") || go.GetPropertyValue("JB_METER_NAME").ToString().Equals("重前") || go.GetPropertyValue("JB_METER_NAME").ToString().Equals("山城") || go.GetPropertyValue("JB_METER_NAME").ToString().Equals("天津自动化") || go.GetPropertyValue("JB_METER_NAME").ToString().Equals("其他"))
                   {
                       this.JB_METER_NAME.Text = go.GetPropertyValue("JB_METER_NAME").ToString();
                   }
                else
                {
                    this.JB_METER_NAME_OTHER.Text = go.GetPropertyValue("JB_METER_NAME").ToString();
                }
                      
                //IC卡表厂家型号
                if (go.GetPropertyValue("IC_METER_NAME").ToString().Equals("华捷") || go.GetPropertyValue("IC_METER_NAME").ToString  ().Equals("赛福") || go.GetPropertyValue("IC_METER_NAME").ToString().Equals("秦川") || go.GetPropertyValue("IC_METER_NAME").ToString().Equals("秦港") || go.GetPropertyValue("IC_METER_NAME").ToString().Equals("致力") || go.GetPropertyValue("IC_METER_NAME").ToString().Equals("其他") )
                   {
                      this.IC_METER_NAME.Text = go.GetPropertyValue("IC_METER_NAME").ToString();
                   }
                else
                {
                    this.IC_METER_NAME_OTHER.Text = go.GetPropertyValue("IC_METER_NAME").ToString();
                }
                
                ObjectList lines = go.GetPropertyValue("LINES") as ObjectList;
                //不存在隐患
                if (lines == null)
                    return;

                foreach (GeneralObject line in lines)
                {
                    String EQUIPMENT = line.GetPropertyValue("EQUIPMENT") as string;
                    String CONTENT = line.GetPropertyValue("CONTENT") as string;
                    if (EQUIPMENT.Equals("安全隐患"))
                        CheckCheckBox(CONTENT, precautionCheckPane);
                    else if (EQUIPMENT.Equals("燃气表"))
                        CheckCheckBox(CONTENT, MeterDefectsPane);
                    else if (EQUIPMENT.Equals("立管"))
                        CheckPlumbingBox(CONTENT, PlumbingDefectsPane);
                    else if (EQUIPMENT.Equals("阀门表前阀"))
                        CheckCheckBox(CONTENT, PlumbingMeterValvePane);
                    else if (EQUIPMENT.Equals("阀门灶前阀"))
                        CheckCheckBox(CONTENT, PlumbingCookerValvePane);
                    else if (EQUIPMENT.Equals("阀门自闭阀"))
                        CheckCheckBox(CONTENT, PlumbingAutomaticValvePane);
                    else if (EQUIPMENT.Equals("户内管"))
                        CheckCheckBox(CONTENT, PlumbingPipePane);
                    else if (EQUIPMENT.Equals("灶具软管"))
                        CheckCheckBox(CONTENT, CookerPipePane);
                    else if (EQUIPMENT.Equals("热水器软管"))
                        CheckCheckBox(CONTENT, BoilerPipePane);
                    else if (EQUIPMENT.Equals("热水器安全隐患"))
                        CheckCheckBox(CONTENT, BoilerDefectsPane);
                    else if (EQUIPMENT.Equals("壁挂锅炉安全隐患"))
                        CheckCheckBox(CONTENT, WHEDefectsPane);
                }

            }

        }
Esempio n. 16
0
        /// <summary>
        /// 根据模板复制对象
        /// </summary>
        /// <param name="tobj">模板对象</param>
        /// <param name="source">数据源对象</param>

        public void CopyFromTemple(GeneralObject tobj, GeneralObject source)
        {
            Dictionary<string, object> dic = new Dictionary<string, object>(tobj._customPropertyValues);
            foreach (KeyValuePair<string, object> item in dic)
            {
                object value = source.GetPropertyValue(item.Key);
                SetPropertyValue(item.Key, value, true);
            }            /*
            foreach (KeyValuePair<string, object> item in tobj._customPropertyValues)
            {
                object value = source.GetPropertyValue(item.Value + "");
                SetPropertyValue(item.Key, value, true);
            }*/
        }
Esempio n. 17
0
        /**
         * 主工作方法定时得到通道信息
         **/
        void work_Tick(object sender, EventArgs e)
        {
            JsonObject jo = new JsonObject();
            jo.Add("aId", this.GongHao);
            jo.Add("aChannel", int.Parse(this.LineNum));
            jo.Add("aModule", 1);
            jo.Add("aBzType", "nvl");
            jo.Add("aName", this.LoginName);

            WebClient client = new WebClient();
            client.UploadStringCompleted += (o, a) =>
            {
                if (a.Error == null)
                {
                    //更新数据
                    JsonObject items = JsonValue.Parse(a.Result) as JsonObject;
                    GeneralObject go = new GeneralObject();
                    go.FromJson(items);
                    if (go == null)
                    {
                        this.PhoneState = GetPropertyValue("14") + "";
                        this.callNumber = "";
                        return;
                    }
                    //设置电话信息
                    //string stateIndex = go.GetPropertyValue("aState") + "";
                    ////如果状态是接听,并且电话号码和录音号与语音服务部相同,设置
                    //this.PhoneState = GetPropertyValue(stateIndex) + "";
                    this.PhoneState = (String)go.GetPropertyValue("aState");
                    //如果电话号码相同,不通知
                    string oldNumber = this.CallNumber;
                    if (oldNumber == null)
                    {
                        oldNumber = "";
                    }
                    
                    string newNumber = (String)(go.GetPropertyValue("callingNo"));
                    if(newNumber == null || newNumber.Length==0)
                        newNumber = "";
                    if (newNumber != null && !newNumber.Equals("") && !oldNumber.Equals(newNumber))
                    {
                        this.CallNumber = newNumber;
                    }
                    //如果记录号不相同,设置
                    string oldRecordFile = this.RecordFile;
                    if (oldRecordFile == null)
                    {
                        oldRecordFile = "";
                    }
                    string newRecordFile = go.GetPropertyValue("callRecId") + "";
                    if (newRecordFile != null && !newRecordFile.Equals("") && !oldRecordFile.Equals(newRecordFile))
                    {
                        this.RecordFile = newRecordFile;
                    }
                    object yhaf = go.GetPropertyValue("yhaf");
                    
                    if (yhaf != null && yhaf.ToString() == "1")
                        this.FaxHint = "有传真";
                    else
                        this.FaxHint = "";

                    object ss = go.GetPropertyValue("serverState");
                    if (bool.Parse(ss.ToString()))
                        ServerState = "语音服务正常";
                    else
                        ServerState = "语音服务异常";
                    State = State.Loaded;
                }
                else
                {
                    this.PhoneState = GetPropertyValue("14") + "";
                    ServerState = "语音服务异常";
                    this.CallNumber = "";
                    this.FaxHint = "";
                    State = State.LoadError;
                    Error = a.Error.Message;
                }
            };
            client.Headers["Content-Type"] = "text/plain";
            client.UploadStringAsync(new Uri(this.TelServiceUrl), jo.ToString());
        }
Esempio n. 18
0
 /**
  * 主工作方法定时得到通道信息
  **/
 void work_Tick(object sender, EventArgs e)
 {
     string address = this.TelServiceUrl + "/GetLineInfo?lineNum=" + this.LineNum + "&gonghao=" + this.GongHao;
     Uri uri = new Uri(address);
     WebClient client = new WebClient();
     client.DownloadStringCompleted += (o, a) =>
     {
         if (a.Error == null)
         {
             //更新数据
             JsonObject items = JsonValue.Parse(a.Result) as JsonObject;
             items["PhoneState"] = items["State"];
             items.Remove("State");
             GeneralObject go = new GeneralObject();
             go.FromJson(items);
             if (go == null)
             {
                 this.PhoneState = GetPropertyValue("14") + "";
                 return;
             }
             //设置电话信息
             string stateIndex = go.GetPropertyValue("PhoneState") + "";
             //如果状态是接听,并且电话号码和录音号与语音服务部相同,设置
             this.PhoneState = GetPropertyValue(stateIndex) + "";
             //如果电话号码相同,不通知
             string oldNumber = this.CallNumber;
             if (oldNumber == null)
             {
                 oldNumber = "";
             }
             string newNumber = go.GetPropertyValue("CallerPhone") + "";
             if (newNumber != null && !newNumber.Equals("") && !oldNumber.Equals(newNumber))
             {
                 this.CallNumber = newNumber;
             }
             //如果记录号不相同,设置
             string oldRecordFile = this.RecordFile;
             if (oldRecordFile == null)
             {
                 oldRecordFile = "";
             }
             string newRecordFile = go.GetPropertyValue("RecordFile") + "";
             if (newRecordFile != null && !newRecordFile.Equals("") && !oldRecordFile.Equals(newRecordFile))
             {
                 this.RecordFile = newRecordFile;
             }
             State = State.Loaded;
         }
         else
         {
             this.PhoneState = GetPropertyValue("14") + "";
             State = State.LoadError;
             Error = a.Error.Message;
         }
     };
     //client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
     client.DownloadStringAsync(uri, "");
 }
Esempio n. 19
0
 /// <summary>
 /// 把json转成报表对象
 /// </summary>
 /// <param name="json"></param>
 private void jsonToTable(string json)
 {
     this.cells.Clear();
     this.columns.Clear();
     this.rows.Clear();
     JsonObject item = JsonValue.Parse(json) as JsonObject;
     GeneralObject go = new GeneralObject();
     go.FromJson(item);
     //列
     ObjectList ol = go.GetPropertyValue("Column") as ObjectList;
     foreach (GeneralObject one in ol)
     {
         Column c = new Column();
         c.Width = Int32.Parse(one.GetPropertyValue("Width") + "");
         this.columns.Add(c);
     }
     //行
     ol = go.GetPropertyValue("Row") as ObjectList;
     foreach (GeneralObject one in ol)
     {
         Row r = new Row();
         r.Height = Int32.Parse(one.GetPropertyValue("Height")+"");
         this.rows.Add(r);
     }
     //单元格
     ol = go.GetPropertyValue("Cell") as ObjectList;
     foreach (GeneralObject one in ol)
     {
         Cell c = new Cell();
         c.Content = one.GetPropertyValue("Content") + "";
         c.Column = Int32.Parse(one.GetPropertyValue("Column") + "");
         c.ColumnSpan = Int32.Parse(one.GetPropertyValue("ColumnSpan") + "");
         c.Row = Int32.Parse(one.GetPropertyValue("Row") + "");
         c.RowSpan = Int32.Parse(one.GetPropertyValue("RowSpan") + "");
         c.Location = one.GetPropertyValue("Location") + "";
         this.cells.Add(c);
     }
     //绘制报表
     Layout();
 }
        void dansearch_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
        {
            //有错误
            if (e.Error != null)
            {
                MessageBox.Show(e.Error.Message);
            }
            else
            {

                //把数据转换成JSON
                JsonArray items = JsonValue.Parse(e.Result) as JsonArray;

                daninfos.ItemsSource = list;
                if(list.Size!=0)
                {
                    list.Clear();
                }
                foreach (JsonObject json in items)
                {
                    GeneralObject go = new GeneralObject();
                    try
                    {
                        go.EntityType = "t_handplan";



                        string f_userid = (string)json["f_userid"];//用户编号
                        go.SetPropertyValue("f_userid", f_userid, false);
                        string f_username = (string)json["f_username"];//用户名
                        go.SetPropertyValue("f_username", f_username, false);
                        string f_address = (string)json["f_address"];//地址
                        go.SetPropertyValue("f_address", f_address, false);
                        decimal lastinputgasnum = (decimal)json["lastinputgasnum"];//上期指数
                        go.SetPropertyValue("lastinputgasnum", lastinputgasnum, false);
                        list.Add(go);
                    }
                    catch (Exception ex)
                    {
                        ui_handBusy.IsBusy = false;
                        MessageBox.Show("用户:"+go.GetPropertyValue("f_userid")+"抄表数据有问题,请核查!");
                        MessageBox.Show(ex.ToString() + "" + go.GetPropertyValue("f_userid"));
                        return;
                    }
                }
            }
            ui_handBusy.IsBusy = false;
        }
Esempio n. 21
0
 public void OpenOrClose_(GeneralObject go, string name)
 {
     // 在打开列表里,为打开状态,否则,为关闭状态
     int index = opened.IndexOf(go);
     // 没打开
     if (index == -1)
     {
         // 把该项内容加载到打开列表里
         opened.Add(go);
         // 把当前选中项的属性值,放到selectedValue中,以便产生SQL语句时用
         string value = go.GetPropertyValue(name).ToString();
         this.selectedValues.Add(value);
         // 改变级别
         this.Level = opened.Count;
         // 加载数据,加载以后,要把前几个级别的数据添加进去
         this.DataLoaded += new System.ComponentModel.AsyncCompletedEventHandler(GroupList_DataLoaded);
         this.Load();
     }
 }