private void save_Click(object sender, RoutedEventArgs e)
        {
            String sql = "update t_handplan set f_username='******'" +
                         ",lastinputdate='" + ui_lastinputdatechange.Text + "'" +
                         ",lastinputgasnum='" + ui_lastinputgasnumchange.Text + "'" +
                         ",f_inputtor='" + ui_inputtorchange.SelectedValue + "'" +
                         ",f_phone='" + ui_phonechange.Text + "'" +
                         ",f_address='" + ui_addresschange.Text + "'" +
                         ",f_usertype='" + ui_usertypechange.Text + "'" +
                         ",f_weizhi='" + ui_weizhichange.Text + "'" +
                         ",f_gasproperties='" + CoboxGasPro.SelectedValue + "'" +
                         ",f_gaspricetype='" + CoboxGas.SelectedValue + "'" +
                         ",f_gasprice='" + ui_gaspricechange.Text + "'" +
                         ",f_metertype='" + ui_metertypechange.SelectedValue + "'" +
                         ",f_gasmetermanufacturers='" + ui_gasmetermanufacturerschange.Text + "'" +
                         ",f_gasmeterstyle='" + ui_gasmeterstylechange.Text + "'" +
                         ",f_meternumber='" + ui_meternumberchange.Text + "'" +
                         ",f_aliasname='" + ui_aliasnamechange.Text + "' where f_state='未抄表' and f_userid='" + ui_userid.Text + "'";
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "abc";
            action.Invoke();
            //如果数据有误,页面提示
            //回调页面保存按钮功能
            SyncActionFactory save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as SyncActionFactory;

            save.Invoke();
            //updatehandplan.New();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (ui_SearchUserList.Count < 1 || CoboxStair.SelectedValue == null || "".Equals(CoboxStair.SelectedValue))
            {
                MessageBox.Show("请选择要修改用户和阶梯水价");
                return;
            }
            ui_searchBusy.IsBusy = true;
            search.Search();

            string sql = "update t_userinfo set f_stairtype='" + CoboxStair.SelectedValue + "', f_stair1amount=" + ui_stair1amount.Text + " , " +
                         "f_stair1price=" + ui_stair1price.Text + " , f_stair2amount='" + ui_stair2amount.Text + "', f_stair2price=" + ui_stair2price.Text + ",f_stair3amount='" + ui_stair3amount.Text + "', f_stair3price=" + ui_stair3price.Text + ", f_stair4price=" + ui_stair4price.Text + ", f_zongjiprice=" + ui_zongjiprice.Text + " ,f_stairmonths=" + ui_stairmonths.Text + " where " + search.Condition + "";
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "t_userfiles";
            action.Completed    += action_Completed;
            action.Invoke();

            string sql1 = "update t_userfiles set f_stairtype='" + CoboxStair.SelectedValue + "', f_stair1amount=" + ui_stair1amount.Text + " , " +
                          "f_stair1price=" + ui_stair1price.Text + " , f_stair2amount='" + ui_stair2amount.Text + "', f_stair2price=" + ui_stair2price.Text + ",f_stair3amount='" + ui_stair3amount.Text + "', f_stair3price=" + ui_stair3price.Text + ", f_stair4price=" + ui_stair4price.Text + ", f_zongjiprice=" + ui_zongjiprice.Text + " ,f_stairmonths=" + ui_stairmonths.Text + " where " + search.Condition + "";
            HQLAction action1 = new HQLAction();

            action1.HQL           = sql1;
            action1.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action1.Name          = "t_userfiles";
            action1.Invoke();
        }
Exemple #3
0
 private void save_Click(object sender, RoutedEventArgs e)
 {
     if (ui_id.Text == null)
     {
         MessageBox.Show("无收费记录");
         return;
     }
     try
     {
         String    sql    = "update t_apply set f_actualfee=f_actualfee-(select f_fee from t_paydetail where id=" + ui_id.Text + ") where f_code='" + ui_code.Text + "'";
         HQLAction action = new HQLAction();
         action.HQL           = sql;
         action.Type          = "sql";
         action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
         action.Name          = "abc";
         action.Invoke();
         String    sql1    = "update t_paydetail set f_state='无效' where id=" + ui_id.Text;
         HQLAction action1 = new HQLAction();
         action1.HQL           = sql1;
         action1.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
         action1.Name          = "abc1";
         action1.Invoke();
         //GeneralObject go1=(from p in loader.Res where p.Name.Equals("reversalmx") select p).First() as GeneralObject;
         //go1.SetValue("id",null);
         SyncActionFactory save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as SyncActionFactory;
         save.Invoke();
         ((from p in loader.Res where p.Name.Equals("paydetails") select p).First() as GeneralObject).IsInit = true;
         //go1.IsInit = true;
         (reversalmxgrid.DataContext as GeneralObject).IsInit = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show("请记录用户情况,联系管理员");
     }
 }
        //鼠标离开时,计算阶梯水价
        private void ui_jianamount_LostFocus(object sender, RoutedEventArgs e)
        {
            //拿出datagrid所选数据
            GeneralObject go = handUserUnits.SelectedItem as GeneralObject;
            //取用户编号
            string userinfoid = ui_userinfoid.Text;
            //计算水量
            int amount     = int.Parse(ui_oughtamount.Text);
            int jianamount = int.Parse(ui_jianamount.Text);
            int pregas     = amount - jianamount;

            ui_oughtamount.Text = pregas.ToString();
            if (pregas < 0)
            {
                MessageBox.Show("抄表指数录入错误或减免水量过大");
                return;
            }

            string    sql1    = "update t_handplan set f_state= '" + "待审核" + "' where f_userinfoid=" + userinfoid + " and oughtfee!=null and shifoujiaofei = '否' and lastinputdate>=" + ui_lastinputdate.Text;
            HQLAction action1 = new HQLAction();

            action1.HQL           = sql1;
            action1.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action1.Name          = "handplan";
            action1.Invoke();

            list = new ObjectList();
            list.LoadOnPathChanged = false;
            list.EntityType        = "t_handplan";
            list.Path          = "from t_handplan where f_userinfoid=" + userinfoid + "and f_state= '" + "待审核" + "' and oughtfee!=null and shifoujiaofei = '否' and lastinputdate>=" + ui_lastinputdate.Text;
            list.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            list.Completed    += LoadBuildingAndOthers_Completed;
            list.Load();
        }
Exemple #5
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if ((userfiles.ItemsSource as PagedList).Count < 1 || CoboxStair.SelectedValue == null || "".Equals(CoboxStair.SelectedValue))
     {
         MessageBox.Show("请选择要修改用户和阶梯气价");
         return;
     }
     ui_searchBusy.IsBusy = true;
     search.Search();
     if (!"1=1".Equals(search.Condition.Trim()) && null != search.Condition)
     {
         if (ui_stairmonths.Text != "" || ui_stair1amount.Text != "" || ui_stair1price.Text != "" || ui_stair2amount.Text != "" || ui_stair2price.Text != "" || ui_stair3amount.Text != "" || ui_stair3price.Text != "" || CoboxStair.SelectedValue != null)
         {
             //提交更改
             string sql = "update t_userinfo set f_stairtype='" + CoboxStair.SelectedValue + "', f_stair1amount=" + ui_stair1amount.Text + " , " +
                          "f_stair1price=" + ui_stair1price.Text + " , f_stair2amount='" + ui_stair2amount.Text + "', f_stair2price=" + ui_stair2price.Text + ",f_stair3amount='" + ui_stair3amount.Text + "', f_stair3price=" + ui_stair3price.Text + ", f_stair4price=" + ui_stair4price.Text + " ,f_stairmonths=" + ui_stairmonths.Text + " where " + search.Condition + "";
             HQLAction action = new HQLAction();
             action.HQL           = sql;
             action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
             action.Name          = "t_userfiles";
             action.Completed    += action_Completed;
             action.Invoke();
         }
     }
     else
     {
         MessageBox.Show("请先按照条件筛选出变更的用户,再确认变更!");
         ui_searchBusy.IsBusy = false;
     }
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //拿出datagrid所选数据
            GeneralObject go = OtherUserUnits.SelectedItem as GeneralObject;
            //拿出页面数据上下文
            GeneralObject updatehandplan = OtherUserUnit.DataContext as GeneralObject;
            //新建对象,往t_updatehandplan插入数据
            GeneralObject obj = new GeneralObject();

            try
            {
                obj.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                obj.EntityType    = "t_updateotherfee";
                obj.SetPropertyValue("f_userid", ui_userid.Text, false);
                obj.SetPropertyValue("f_username", ui_username.Text, false);
                obj.SetPropertyValue("f_address", ui_address.Text, false);
                obj.SetPropertyValue("f_sellid", go.GetPropertyValue("id").ToString(), false);


                obj.SetPropertyValue("f_feetype", go.GetPropertyValue("f_feetype").ToString(), false);
                obj.SetPropertyValue("f_newfeetype", ui_f_feetype.Text, false);
                obj.SetPropertyValue("f_fee", decimal.Parse(go.GetPropertyValue("f_fee").ToString()), false);
                obj.SetPropertyValue("f_newfee", decimal.Parse(ui_f_fee.Text), false);
                obj.SetPropertyValue("f_payfeevalid", go.GetPropertyValue("f_payfeevalid").ToString(), false);
                obj.SetPropertyValue("f_newpayfeevalid", ui_payfeevalid.SelectedValue, false);

                obj.SetPropertyValue("f_sellinggasoperator", ui_handplanoperator.Text, false);
                obj.SetPropertyValue("f_sellinggasdate", ui_handplandate.SelectedDate, false);
                obj.SetPropertyValue("f_updatenote", ui_updatenote.Text, false);
                obj.Name = "t_updateotherfee";
                //obj.Completed += obj_Completed;
                obj.Save();
            }
            catch (Exception a)
            {
                MessageBox.Show(a.Message);
            }
            //MessageBox.Show(go.GetPropertyValue("id").ToString());
            //  MessageBox.Show(ui_handplandate.SelectedDate.ToString());
            //oughtfee shifoujiaofei f_operator f_inputtor f_zhinajindate
            string sql = "update t_otherfee set f_feetype= '" + ui_f_feetype.Text +
                         "',f_fee=" + decimal.Parse(ui_f_fee.Text) + ",f_payfeevalid='" + ui_payfeevalid.SelectedValue +
                         "' where id = " + go.GetPropertyValue("id");
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "abc";
            action.Invoke();

            //如果数据有误,页面提示
            //回调页面保存按钮功能
            BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;

            save.State = State.End;
            PagedObjectList save1 = (from p in loader.Res where p.Name.Equals("personlist") select p).First() as PagedObjectList;

            save1.IsOld = true;
            updatehandplan.New();
        }
        private void ui_SaveStairButton_Click(object sender, RoutedEventArgs e)
        {
            if (count == 1)
            {
                if (ui_stairtype.Text != "" || ui_stair1amount.Text != "" || ui_stair1price.Text != "" || ui_stair2amount.Text != "" || ui_stair2price.Text != "" || ui_stair3amount.Text != "" || ui_stair3price.Text != "" || ui_stairmonths.SelectedValue != null)
                {
                    ui_searchBusy.IsBusy = true;
                    // 通过执行sql语句进行设置
                    string sql = "update t_stairprice set f_stairtype='" + ui_stairtype.Text + "', f_stair1amount=" + ui_stair1amount.Text + " , " +
                                 "f_stair1price=" + ui_stair1price.Text + " , f_stair2amount='" + ui_stair2amount.Text + "', f_stair2price=" + ui_stair2price.Text + ",f_stair3amount='" + ui_stair3amount.Text + "', f_stair3price=" + ui_stair3price.Text + ", f_stair4price=" + ui_stair4price.Text + ",f_stairmonths=" + ui_stairmonths.SelectedValue + " where id=" + ui_id.Text;
                    HQLAction action = new HQLAction();
                    action.HQL           = sql;
                    action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                    action.Name          = "t_stairprice";
                    action.Completed    += action_Completed;
                    action.Invoke();
                }
                else
                {
                    MessageBox.Show("请输入完整信息!");
                    return;
                }
            }
            else
            {
                if (ui_stairtype.Text != "" || ui_stair1amount.Text != "" || ui_stair1price.Text != "" || ui_stair2amount.Text != "" || ui_stair2price.Text != "" || ui_stair3amount.Text != "" || ui_stair3price.Text != "" || ui_stairmonths.SelectedValue != null)
                {
                    ui_searchBusy.IsBusy = true;
                    GeneralObject obj = new GeneralObject();
                    obj.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                    obj.EntityType    = "t_stairprice";
                    obj.SetPropertyValue("f_stairtype", ui_stairtype.Text, false);
                    obj.SetPropertyValue("f_stair1amount", ui_stair1amount.Text, false);
                    obj.SetPropertyValue("f_stair1price", ui_stair1price.Text, false);
                    obj.SetPropertyValue("f_stair2amount", ui_stair2amount.Text, false);
                    obj.SetPropertyValue("f_stair2price", ui_stair2price.Text, false);
                    obj.SetPropertyValue("f_stair3amount", ui_stair3amount.Text, false);
                    obj.SetPropertyValue("f_stair3price", ui_stair3price.Text, false);
                    obj.SetPropertyValue("f_stair4price", ui_stair4price.Text, false);
                    obj.SetPropertyValue("f_stairmonths", ui_stairmonths.SelectedValue, false);
                    obj.SetPropertyValue("extraprice", extraPrice.ItemsSource, false);
                    obj.Name       = "t_stairprice";
                    obj.Completed += obj_Completed;
                    obj.Save();
                }
                else
                {
                    MessageBox.Show("请输入完整信息!");
                    return;
                }
            }
            BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;

            save.Invoke();
        }
Exemple #8
0
        private void save_Click(object sender, RoutedEventArgs e)
        {
            ui_userBusy1.IsBusy = true;
            string    sql    = "update t_otherfee set f_conclenote='" + ui_f_conclenote.Text + "',f_payfeevalid='无效' where id=" + ui_id.Text;
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "t_otherfee";
            action.Completed    += action_Completed;
            action.Invoke();
        }
        private void onlySave_Click(object sender, RoutedEventArgs e)
        {
            ui_meterBusy.IsBusy = true;
            string    sql    = "update t_changmeter set f_cancelnote='" + ui_f_cancelnote.Text + "',f_canceldate='" + ui_f_canceldate.SelectedDate + "',f_cxoperation='" + ui_f_cxoperation.Text + "',f_payfeevalid='无效' where id=" + ui_id.Text;
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "t_changmeter";
            action.Completed    += action_Completed;
            action.Invoke();
        }
Exemple #10
0
        private void saveButton_Click(object sender, RoutedEventArgs e)
        {
            ui_handBusy.IsBusy = true;


            BaseObjectList list = daninfos.ItemsSource as BaseObjectList;

            List <GeneralObject> removed = new List <GeneralObject>();

            //对于每一条记录
            foreach (GeneralObject go in list)
            {
                //表具编号
                var userid = go.GetPropertyValue("f_userid");
                //抄表id
                var id = go.GetPropertyValue("id");
                // 抄表记录里的上期指数
                var lastinputnum = go.GetPropertyValue("lastinputgasnum");

                // 本次抄表指数
                var lastrecord = go.GetPropertyValue("lastrecord");

                // 抄表记录里的阶梯类型
                var stairType = go.GetPropertyValue("f_stairtype");
                // 用水量
                var oughtamount = go.GetPropertyValue("oughtamount");
                // 本次指数为空,这条不上传
                if (lastrecord == null)
                {
                    continue;
                }

                // 本期指数小于上期指数,不上传
                if (double.Parse(lastrecord.ToString()) < double.Parse(lastinputnum.ToString()))
                {
                    MessageBox.Show("表" + userid + "本期指数异常,请核查");
                    continue;
                }
                removed.Add(go);
                string    sql    = "update t_handplan set lastrecord=" + lastrecord + ",f_state= '" + "待审核" + "',oughtamount= " + oughtamount + " where id=" + id;
                HQLAction action = new HQLAction();
                action.HQL           = sql;
                action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                action.Name          = "t_handplan";
                action.Completed    += action_Completed;
                action.Invoke();
            }
            foreach (GeneralObject go in removed)
            {
                list.Remove(go);
            }
        }
        void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            busy.IsBusy = false;
            //把数据转换成JSON
            JsonObject item = JsonValue.Parse(e.Result) as JsonObject;

            // 没有出错
            if (e.Error == null)
            {
                GeneralObject printobj = aofengprint.DataContext as GeneralObject;
                printobj.FromJson(item);
                //string date = (string)item["f_deliverydate"];
                //ui_day.Text = date;
                //保存发票信息
                GeneralObject fpinfosobj = (GeneralObject)(from r in loader.Res where r.Name.Equals("fpinfosobj") select r).First();
                fpinfosobj.SetPropertyValue("f_fapiaostatue", "已用", true);
                fpinfosobj.Save();
                // 调用打印
                MessageBoxResult mbr = MessageBox.Show("是否打印", "提示", MessageBoxButton.OKCancel);
                if (mbr == MessageBoxResult.OK)
                {
                    print.TipPrint();
                    print.Completed += print_Completed;
                }
                else
                {
                    GeneralObject kbfee = (GeneralObject)(from r in loader.Res where r.Name.Equals("kbfee") select r).First();
                    kbfee.New();
                }
                //交费开阀
                if (count > 0)
                {
                    //更新阀门控制状态
                    string sql = "update t_userfiles set f_operate_zl='启用', f_returnvalueoperate=" + "'1' " +
                                 " where f_userid='" + iesid + "'";
                    HQLAction action = new HQLAction();
                    action.HQL           = sql;
                    action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                    action.Name          = "t_userfiles";
                    action.Completed    += action_Completed;
                    action.Invoke();
                }
            }
            else
            {
                // 提示出错
                MessageBox.Show("连接服务器失败,请重试!如果继续失败,请联系系统管理员。");
                // 清除界面数据
                GeneralObject kbfee = (GeneralObject)(from r in loader.Res where r.Name.Equals("kbfee") select r).First();
                kbfee.New();
            }
        }
        private void action_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            string sql = "update t_userfiles set f_initcardsellgas = null,f_gasmeterstyle='"
                         + f_gasmeterstyle.Text + "',f_meternumber='" + f_meternumber.Text + "',f_gasmetermanufacturers='" + ui_gasmetermanufacturers.Text +
                         "',f_gaswatchbrand='" + ui_gaswatchbrand.Text + "',f_metertype='" + ui_metertype.Text + "',f_gasmeterkoujing='" + ui_gasmeterkoujing.Text + "' where f_userid=" + f_userid.Text;
            HQLAction action1 = new HQLAction();

            action1.HQL           = sql;
            action1.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action1.Name          = "t_userfiles";
            action1.Completed    += action_Completed1;
            action1.Invoke();
        }
Exemple #13
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ui_searchBusy.IsBusy = true;
            search.Search();

            string    sql    = "update t_repairsys set f_downloadstatus=NULL,f_accepter='" + f_accepter.SelectedValue + "' where " + search.Condition + "";
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "t_repairsys";
            action.Completed    += action_Completed;
            action.Invoke();
        }
        private void save_Click(object sender, RoutedEventArgs e)
        {
            ui_userfileschange.IsBusy = true;

            String sql = "update t_handplan set f_username='******'" +
                         ",lastinputdate='" + ui_lastinputdatechange.Text + "'" +
                         ",lastinputgasnum='" + ui_lastinputgasnumchange.Text + "'" +
                         ",f_inputtor='" + ui_inputtorchange.SelectedValue + "'" +
                         ",f_phone='" + ui_phonechange.Text + "'" +
                         ",f_address='" + ui_addresschange.Text + "'" +
                         ",f_usertype='" + ui_usertypechange.Text + "'" +
                         ",f_weizhi='" + ui_weizhichange.Text + "'" +
                         ",f_gasproperties='" + CoboxGasPro.SelectedValue + "'" +
                         ",f_gaspricetype='" + CoboxGas.SelectedValue + "'" +
                         ",f_gasprice='" + ui_gaspricechange.Text + "'" +
                         ",f_metertype='" + ui_metertypechange.SelectedValue + "'" +
                         ",f_gasmetermanufacturers='" + ui_gasmetermanufacturerschange.Text + "'" +
                         ",f_gasmeterstyle='" + ui_gasmeterstylechange.Text + "'" +
                         ",f_meternumber='" + ui_meternumberchange.Text + "'" +
                         ",f_stairtype='" + CoboxStair.SelectedValue.ToString() + "'" +
                         ",f_aliasname='" + ui_aliasnamechange.Text + "' where f_state='未抄表' and f_userid='" + ui_userid.Text + "'";
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "abc";
            action.Invoke();

            GeneralObject obj = userfileschange.DataContext as GeneralObject;

            userid = obj.GetPropertyValue("f_userid") + "";
            if ((obj.GetPropertyValue("f_meternumber") + "").Equals(obj.GetPropertyValue("f_meternumberchange") + "") && (obj.GetPropertyValue("terminal_name") + "").Equals(obj.GetPropertyValue("terminal_namechange") + "") && (obj.GetPropertyValue("meter_phone") + "").Equals(obj.GetPropertyValue("meter_phonechange") + ""))
            {
                ui_refreshCachechange.Text = "0";
            }
            else
            {
                //{
                //if ("物联网表".Equals(ui_gasmeterstylechange.Text))
                ui_refreshCachechange.Text = "1";
            }
            //else
            //ui_refreshCachechange.Text = "0";
            //}
            BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;

            save.Completed += save_Completed;
            save.Invoke();
        }
Exemple #15
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ui_searchBusy.IsBusy = true;
            search.Search();

            string sql = "update t_userfiles set f_stairtype='" + CoboxStair.SelectedValue + "', f_stair1amount=" + ui_stair1amount.Text + " , " +
                         "f_stair1price=" + ui_stair1price.Text + " , f_stair2amount='" + ui_stair2amount.Text + "', f_stair2price=" + ui_stair2price.Text + ",f_stair3amount='" + ui_stair3amount.Text + "', f_stair3price=" + ui_stair3price.Text + ", f_stair4price=" + ui_stair4price.Text + " ,f_stairmonths=" + ui_stairmonths.Text + " where " + search.Condition + "";
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "t_userfiles";
            action.Completed    += action_Completed;
            action.Invoke();
        }
        private void action_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            HQLAction action = sender as HQLAction;

            action.Completed -= action_Completed;

            if (e.Error == null)
            {
                //将产生的json串送后台服务进行处理
                WebClientInfo wci    = Application.Current.Resources["server"] as WebClientInfo;
                string        uri    = wci.BaseAddress + "/iesgas/table/comand";
                WebClient     client = new WebClient();
                client.UploadStringAsync(new Uri(uri), "[{\"search\":\"f_userid like '" + iesid + "'\"}]");
            }
        }
Exemple #17
0
        private void save_Click(object sender, RoutedEventArgs e)
        {
            String sql = "update t_handplan set f_username='******'" +
                         ",f_inputtor='" + ui_inputtorchange.SelectedValue + "'" +
                         ",f_phone='" + ui_phonechange.Text + "'" +
                         ",f_address='" + ui_addresschange.Text + "'" +
                         ",f_usertype='" + ui_usertypechange.SelectedValue + "'" +
                         ",f_handarea='" + ui_handareachange.SelectedValue + "'" +
                         ",f_gasproperties='" + CoboxGasPro.SelectedValue + "'" +
                         ",f_stairtype='" + CoboxStair.SelectedValue + "'" +
                         ",f_extrawaterprice='" + ui_extrawaterpricechange.Text + "' where f_state='未抄表' and f_userinfoid='" + ui_userid.Text + "'";
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "abc";
            action.Invoke();
            String sql1 = "update t_userfiles set f_username='******'" +
                          ",f_inputtor='" + ui_inputtorchange.SelectedValue + "'" +
                          ",f_phone='" + ui_phonechange.Text + "'" +
                          ",f_address='" + ui_addresschange.Text + "'" +
                          ",f_usertype='" + ui_usertypechange.SelectedValue + "'" +
                          ",f_handarea='" + ui_handareachange.SelectedValue + "'" +
                          ",f_gasproperties='" + CoboxGasPro.SelectedValue + "'" +
                          ",f_stairtype='" + CoboxStair.SelectedValue + "'" +
                          ",f_stair1amount='" + f_stair1amountchange.Text + "'" +
                          ",f_stair1price='" + f_stair1pricechange.Text + "'" +
                          ",f_stair2amount='" + f_stair2amountchange.Text + "'" +
                          ",f_stair2price='" + f_stair2pricechange.Text + "'" +
                          ",f_stair3amount='" + f_stair3amountchange.Text + "'" +
                          ",f_stair3price='" + f_stair3pricechange.Text + "'" +
                          ",f_stair4price='" + f_stair4pricechange.Text + "'" +
                          ",f_stairmonths='" + f_stairmonthschange.Text + "'" +
                          ",f_zongjiprice='" + f_zongjipricechange.Text + "'" +
                          ",f_extrawaterprice='" + ui_extrawaterpricechange.Text + "' where f_userinfoid='" + ui_userid.Text + "'";
            HQLAction action1 = new HQLAction();

            action1.HQL           = sql1;
            action1.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action1.Name          = "aaa";
            action1.Invoke();
            //如果数据有误,页面提示
            //回调页面保存按钮功能
            SyncActionFactory save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as SyncActionFactory;

            save.Invoke();
            //updatehandplan.New();
        }
        private void allSend_Click(object sender, RoutedEventArgs e)
        {
            BaseObjectList list = daninfos.ItemsSource as BaseObjectList;


            //对于每一条记录
            foreach (GeneralObject go in list)
            {
                // id
                String smsId = go.GetPropertyValue("id").ToString();

                String    sql    = "update t_sms set f_state='未发' where id=" + smsId + "";
                HQLAction action = new HQLAction();
                action.Name          = "abc";
                action.HQL           = sql;
                action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                action.Invoke();
            }
        }
Exemple #19
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try {
         GeneralObject go = daninfos.SelectedItem as GeneralObject;
         if (go != null)
         {
             f_userid = go.GetPropertyValue("f_userid") + "";
             string sql = "update t_userfiles set f_operate_zl='欠费', f_returnvalueoperate=" + "'1' " +
                          " where f_gasmeterstyle in ('物联网表','物联表','积成远传气表','远传表','短信表') and f_userid='" + f_userid + "'";
             HQLAction action = new HQLAction();
             action.HQL           = sql;
             action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
             action.Name          = "t_userfiles";
             action.Completed    += action_Completed;
             action.Invoke();
         }
     }
     catch (Exception ex) {
     }
 }
        private void save2_Click(object sender, RoutedEventArgs e)
        {
            ObjectList ol = dataGrid1.ItemsSource as ObjectList;

            foreach (GeneralObject item in ol)
            {
                if (item.IsChecked)
                {
                    string    f_zhinajin = item.GetPropertyValue("f_zhinajin").ToString();
                    string    id         = item.GetPropertyValue("id").ToString();
                    HQLAction hql        = new HQLAction();
                    hql.Name          = "hql";
                    hql.WebClientInfo = ol.WebClientInfo;
                    hql.HQL           = "update t_handplan set f_jmzhinajin=" + f_zhinajin + " where id=" + id;
                    hql.Invoke();
                }
            }
            BatchExcuteAction SaveAction = FrameworkElementExtension.FindResource(this.save2, "SaveAction") as BatchExcuteAction;

            SaveAction.Invoke();
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     ui_searchBusy.IsBusy = true;
     search.Search();
     if (!"1=1".Equals(search.Condition.Trim()) && null != search.Condition)
     {
         //提交更改
         string sql = "update t_userfiles set f_operate_zl='" + f_operate_zl_zl.SelectedValue + "', f_returnvalueoperate=" + "'1' " +
                      " where f_gasmeterstyle in ('物联网表','物联表','积成远传气表','远传表','短信表') and " + search.Condition + "";
         HQLAction action = new HQLAction();
         action.HQL           = sql;
         action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
         action.Name          = "t_userfiles";
         action.Completed    += action_Completed;
         action.Invoke();
     }
     else
     {
         MessageBox.Show("请先按照条件筛选出进行阀门操作的用户,再确认执行!");
         ui_searchBusy.IsBusy = false;
     }
 }
Exemple #22
0
        private void start_Click(object sender, RoutedEventArgs e)
        {
            String flagName = name.Text.ToString();
            String state    = value.Text.ToString();

            if (flagName == "短信功能开关")
            {
                //执行sql开关 状态 改为 开启 短信表里所有待发改为 未发
                String    sql    = "update t_smstemplate set f_state='开启' where f_name='短信功能开关'";
                HQLAction action = new HQLAction();
                action.Name          = "abc";
                action.HQL           = sql;
                action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                action.Invoke();

                sql                  = "update t_sms set f_state = '未发' where f_state = '待发'";
                action.HQL           = sql;
                action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                action.Invoke();
            }
            else
            {
                //开关状态改为开启, 短信表里 此类 待发短信 状态改为 未发
                String    sql    = "update t_smstemplate set f_state='开启' where f_name='" + flagName + "'";
                HQLAction action = new HQLAction();
                action.Name          = "abc";
                action.HQL           = sql;
                action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                action.Invoke();

                sql                  = "update t_sms set f_state = '未发' where f_state = '待发' and f_templatename='" + flagName + "'";
                action.HQL           = sql;
                action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                action.Invoke();
            }
            value.Text = "开启";
        }
Exemple #23
0
        private void action_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            ui_searchBusy.IsBusy = false;
            HQLAction action = sender as HQLAction;

            action.Completed -= action_Completed;

            if (CoboxStair.SelectedValue.ToString() != "")
            {
                GeneralObject go = new GeneralObject();
                go.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                go.EntityType    = "t_changestairprice";
                go.SetPropertyValue("f_stairtype", CoboxStair.SelectedValue, false);
                go.SetPropertyValue("f_stair1amount", ui_stair1amount.Text, false);
                go.SetPropertyValue("f_stair2amount", ui_stair2amount.Text, false);
                go.SetPropertyValue("f_stair3amount", ui_stair3amount.Text, false);
                go.SetPropertyValue("f_stair1price", ui_stair1price.Text, false);
                go.SetPropertyValue("f_stair2price", ui_stair2price.Text, false);
                go.SetPropertyValue("f_stair3price", ui_stair3price.Text, false);
                go.SetPropertyValue("f_stair4price", ui_stair4price.Text, false);
                go.SetPropertyValue("f_stairmonths", ui_stairmonths.Text, false);
                go.SetPropertyValue("f_operator", ui_operator.Text, false);
                go.SetPropertyValue("f_operdate", ui_operdate.SelectedDate, false);
                go.SetPropertyValue("f_counts", ui_counts.Text, false);
                if (ui_usertype.SelectedValue != null)
                {
                    go.SetPropertyValue("f_usertype", ui_usertype.SelectedValue, false);
                }
                if (ui_gasmeterstyle.SelectedValue != null)
                {
                    go.SetPropertyValue("f_gasmeterstyle", ui_gasmeterstyle.SelectedValue, false);
                }
                go.Name       = "t_changestairprice";
                go.Completed += obj_Completed;
                go.Save();

                string json = "[";
                if (ui_stairmonths.Text != "" || ui_stair1amount.Text != "" || ui_stair1price.Text != "" || ui_stair2amount.Text != "" || ui_stair2price.Text != "" || ui_stair3amount.Text != "" || ui_stair3price.Text != "" || CoboxStair.SelectedValue != null)
                {
                    //产生要发送后台的JSON串
                    json += ("{type:\"1\",price_type:\"" + CoboxStair.SelectedValue +
                             "\",money1:\"" + ui_stair1price.Text +
                             "\",limit1:\"" + ui_stair1amount.Text +
                             "\",money2:\"" + ui_stair2price.Text +
                             "\",limit2:\"" + ui_stair2amount.Text +
                             "\",money3:\"" + ui_stair3price.Text +
                             "\",limit3:\"" + ui_stair3amount.Text +
                             "\",money4:\"" + ui_stair4price.Text +
                             "\",limit4:\"999999999" +
                             "\",money5:\"" + ui_stair4price.Text +
                             "\",limit5:\"999999999" +
                             "\",cycle:\"" + ui_stairmonths.Text +
                             "\",idlist:[{search:\"" + search.Condition + "\"}]}");
                    json += "]";
                    //将产生的json串送后台服务进行处理
                    WebClientInfo wci    = Application.Current.Resources["server"] as WebClientInfo;
                    string        uri    = wci.BaseAddress + "/iesgas/gasdj/comand";
                    WebClient     client = new WebClient();
                    client.UploadStringCompleted += client_UploadStringCompleted;
                    client.UploadStringAsync(new Uri(uri), json);
                }
                MessageBox.Show("阶梯变更完成!");
            }
            else
            {
                MessageBox.Show("请输入阶梯气价类型!");
                return;
            }
        }
Exemple #24
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //拿出datagrid所选数据
            GeneralObject go = SellUserUnits.SelectedItem as GeneralObject;
            //拿出页面数据上下文
            GeneralObject updatehandplan = SellUserUnit.DataContext as GeneralObject;
            //新建对象,往t_updatehandplan插入数据
            GeneralObject obj = new GeneralObject();

            try
            {
                obj.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                obj.EntityType    = "t_updatesellinggas";

                obj.SetPropertyValue("f_userid", go.GetPropertyValue("f_userid") + "", false);
                obj.SetPropertyValue("f_newuserid", ui_userid.Text, false);
                obj.SetPropertyValue("f_username", go.GetPropertyValue("f_username") + "", false);
                obj.SetPropertyValue("f_newusername", ui_username.Text, false);
                obj.SetPropertyValue("f_address", go.GetPropertyValue("f_address") + "", false);
                obj.SetPropertyValue("f_newaddress", ui_address.Text, false);
                obj.SetPropertyValue("f_districtname", go.GetPropertyValue("f_districtname") + "", false);
                obj.SetPropertyValue("f_newdistrictname", ui_f_districtname.Text, false);

                obj.SetPropertyValue("f_sellid", go.GetPropertyValue("id").ToString(), false);
                obj.SetPropertyValue("f_usertype", ui_usertype.Text, false);
                if (go.GetPropertyValue("f_zhinajin") == null)
                {
                    go.SetPropertyValue("f_zhinajin", 0.0m, false);
                }
                obj.SetPropertyValue("f_zhinajin", decimal.Parse(go.GetPropertyValue("f_zhinajin").ToString()), false);
                if (ui_f_zhinajin.Text.ToString().Equals(""))
                {
                    ui_f_zhinajin.Text = "0";
                }

                obj.SetPropertyValue("f_newzhinajin", decimal.Parse(ui_f_zhinajin.Text), false);
                if (go.GetPropertyValue("f_amountmaintenance") == null)
                {
                    go.SetPropertyValue("f_amountmaintenance", 0.0m, false);
                }
                obj.SetPropertyValue("f_weihufei", decimal.Parse(go.GetPropertyValue("f_amountmaintenance").ToString()), false);
                if (ui_f_amountmaintenance.Text.ToString().Equals(""))
                {
                    ui_f_amountmaintenance.Text = "0";
                }

                obj.SetPropertyValue("f_newweihufei", decimal.Parse(ui_f_amountmaintenance.Text), false);
                obj.SetPropertyValue("f_shifouyouxiao", go.GetPropertyValue("f_payfeevalid").ToString(), false);
                obj.SetPropertyValue("f_newshifouyouxiao", ui_f_payfeevalid.Text, false);
                obj.SetPropertyValue("f_pregas", decimal.Parse(go.GetPropertyValue("f_pregas").ToString()), false);
                obj.SetPropertyValue("f_newpregas", decimal.Parse(ui_f_pregas.Text), false);
                obj.SetPropertyValue("f_preamount", decimal.Parse(go.GetPropertyValue("f_preamount").ToString()), false);
                obj.SetPropertyValue("f_newpreamount", decimal.Parse(ui_f_preamount.Text), false);
                obj.SetPropertyValue("f_shoukuan", decimal.Parse(go.GetPropertyValue("f_grossproceeds").ToString()), false);
                obj.SetPropertyValue("f_newshoukuan", decimal.Parse(ui_f_grossproceeds.Text), false);
                if (go.GetPropertyValue("f_benqizhye") == null)
                {
                    go.SetPropertyValue("f_benqizhye", 0.0m, false);
                }
                obj.SetPropertyValue("f_zhye", decimal.Parse(go.GetPropertyValue("f_benqizhye").ToString()), false);
                if (ui_f_benqizhye.Text.ToString().Equals(""))
                {
                    ui_f_benqizhye.Text = "0";
                }

                obj.SetPropertyValue("f_newzhye", decimal.Parse(ui_f_benqizhye.Text), false);

                if (go.GetPropertyValue("f_zhye") == null)
                {
                    go.SetPropertyValue("f_zhye", 0.0m, false);
                }
                obj.SetPropertyValue("f_shangqizhye", decimal.Parse(go.GetPropertyValue("f_zhye").ToString()), false);
                if (ui_f_zhye.Text.ToString().Equals(""))
                {
                    ui_f_zhye.Text = "0";
                }

                obj.SetPropertyValue("f_newshangqizhye", decimal.Parse(ui_f_zhye.Text), false);

                if (go.GetPropertyValue("lastinputgasnum") == null)
                {
                    go.SetPropertyValue("lastinputgasnum", 0.0m, false);
                }
                obj.SetPropertyValue("f_lastinputgasnums", decimal.Parse(go.GetPropertyValue("lastinputgasnum").ToString()), false);
                if (ui_f_zhye.Text.ToString().Equals(""))
                {
                    ui_f_zhye.Text = "0";
                }

                obj.SetPropertyValue("f_newlastinputgasnums", decimal.Parse(ui_f_lastinputgasnums.Text), false);

                if (go.GetPropertyValue("lastrecord") == null)
                {
                    go.SetPropertyValue("lastrecord", 0.0m, false);
                }
                obj.SetPropertyValue("f_lastrecord", decimal.Parse(go.GetPropertyValue("lastrecord").ToString()), false);
                if (ui_f_lastrecord.Text.ToString().Equals(""))
                {
                    ui_f_lastrecord.Text = "0";
                }

                obj.SetPropertyValue("f_newlastrecord", decimal.Parse(ui_f_lastrecord.Text), false);


                obj.SetPropertyValue("f_sellinggasoperator", ui_handplanoperator.Text, false);
                obj.SetPropertyValue("f_sellinggasdate", ui_handplandate.SelectedDate, false);
                obj.SetPropertyValue("f_updatenote", ui_updatenote.Text, false);
                obj.Name = "t_updatesellinggas";
                //obj.Completed += obj_Completed;
                obj.Save();
            }
            catch (Exception a)
            {
                MessageBox.Show(a.Message);
            }
            // BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;
            // save.Invoke();

            string sql = "update t_sellinggas set f_zhinajin= " + decimal.Parse(ui_f_zhinajin.Text) +
                         ",f_amountmaintenance=" + decimal.Parse(ui_f_amountmaintenance.Text) +
                         ",f_payfeevalid='" + ui_f_payfeevalid.Text +
                         "',f_pregas=" + decimal.Parse(ui_f_pregas.Text) +
                         ",f_preamount=" + decimal.Parse(ui_f_preamount.Text) +
                         ",f_grossproceeds=" + decimal.Parse(ui_f_grossproceeds.Text) +
                         ",f_benqizhye=" + decimal.Parse(ui_f_benqizhye.Text) +
                         ",f_zhye=" + decimal.Parse(ui_f_zhye.Text) +
                         ",lastinputgasnum=" + decimal.Parse(ui_f_lastinputgasnums.Text) +
                         ",lastrecord=" + decimal.Parse(ui_f_lastrecord.Text) +
                         ",f_userid='" + ui_userid.Text +
                         "',f_payment='" + ui_payment.SelectedValue +
                         "',f_username='******',f_address='" + ui_address.Text +
                         "',f_districtname='" + ui_f_districtname.Text +
                         "'  where id = " + go.GetPropertyValue("id");
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "abc";
            action.Invoke();
            PagedObjectList save1 = (from p in loader.Res where p.Name.Equals("personlist") select p).First() as PagedObjectList;

            save1.IsOld = true;
            updatehandplan.New();
        }
        public void LoadBuildingAndOthers_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            //拿出datagrid所选数据
            GeneralObject go = handUserUnits.SelectedItem as GeneralObject;
            //拿出该条抄表记录的附加费用单价总和
            double extrazj = (double)(go.GetPropertyValue("extrazj"));
            double gas     = double.Parse(ui_oughtamount.Text.ToString());

            for (int i = 0; i < list.Count; i++)
            {
                GeneralObject at = new GeneralObject();
                at.EntityType = "t_handplan";
                GeneralObject oo     = list[i] as GeneralObject;
                string        id     = oo.GetPropertyValue("id").ToString();
                double        pregas = 0;
                if (go.Equals(oo))
                {
                    pregas = double.Parse(gas.ToString());
                }
                else
                {
                    pregas = double.Parse(oo.GetPropertyValue("oughtamount").ToString());
                }
                string userid = oo.GetPropertyValue("f_userid").ToString();
                //转换日期为文本lastinputdate
                String date = ((DateTime)oo.GetPropertyValue("lastinputdate")).ToString("yyyyMMdd");

                WebClientInfo wci    = (WebClientInfo)Application.Current.Resources["server"];
                string        str    = wci.BaseAddress + "/handcharge/num/" + userid + "/" + pregas + "/" + date;
                Uri           uri    = new Uri(str);
                WebClient     client = new WebClient();
                client.DownloadStringCompleted += (o, a) =>
                {
                    //更新数据
                    JsonObject items = JsonValue.Parse(a.Result) as JsonObject;
                    try {
                        at.SetPropertyValue("id", id, false);
                        at.SetPropertyValue("f_stair1amount", (double)items["f_stair1amount"], false);
                        at.SetPropertyValue("f_stair1fee", (double)items["f_stair1fee"], false);
                        at.SetPropertyValue("f_stair2amount", (double)items["f_stair2amount"], false);
                        at.SetPropertyValue("f_stair2fee", (double)items["f_stair2fee"], false);
                        at.SetPropertyValue("f_stair3amount", (double)items["f_stair3amount"], false);
                        at.SetPropertyValue("f_stair3fee", (double)items["f_stair3fee"], false);
                        at.SetPropertyValue("f_stair4amount", (double)items["f_stair4amount"], false);
                        at.SetPropertyValue("f_stair4fee", (double)items["f_stair4fee"], false);
                        at.SetPropertyValue("f_allamont", (double)items["f_allamont"], false);
                        at.SetPropertyValue("oughtfee", (double)items["f_chargenum"], false);
                        handlist.Add(at);
                    }
                    catch (Exception ex)
                    {
                        return;
                    }
                    if (go.Equals(oo))
                    {
                        double oughtfee = double.Parse(at.GetPropertyValue("oughtfee").ToString());
                        ui_oughtfee.Text = oughtfee.ToString();
                        double extrafee = extrazj * gas;
                        ui_f_extraprices.Text = extrafee.ToString();
                        ui_f_fee.Text         = (oughtfee + extrafee).ToString();
                    }
                };
                client.DownloadStringAsync(uri);


                string    sql1    = "update t_handplan set f_state= '" + "已抄表" + "' where id=" + id + "";
                HQLAction action1 = new HQLAction();
                action1.HQL           = sql1;
                action1.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                action1.Name          = "handplan";
                action1.Invoke();
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //拿出datagrid所选数据
            GeneralObject go = handUserUnits.SelectedItem as GeneralObject;
            //拿出页面数据上下文
            GeneralObject updatehandplan = handUserUnit.DataContext as GeneralObject;
            //新建对象,往t_yongshuiliang插入数据
            GeneralObject obj = new GeneralObject();

            try
            {
                obj.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                obj.EntityType    = "t_yongshuiliang";
                obj.SetPropertyValue("f_userid", ui_userid.Text, false);
                obj.SetPropertyValue("f_username", ui_username.Text, false);
                obj.SetPropertyValue("f_address", ui_address.Text, false);
                obj.SetPropertyValue("oughtfee", double.Parse(go.GetPropertyValue("oughtfee").ToString()), false);
                obj.SetPropertyValue("newoughtfee", double.Parse(ui_oughtfee.Text), false);
                obj.SetPropertyValue("f_updatenote", ui_updatenote.Text, false);
                obj.SetPropertyValue("lastinputdate", go.GetPropertyValue("lastinputdate"), false);
                obj.SetPropertyValue("newlastinputdate", ui_lastinputdate.SelectedDate, false);
                obj.SetPropertyValue("oughtamount", double.Parse(go.GetPropertyValue("oughtamount").ToString()), false);
                obj.SetPropertyValue("newoughtamount", double.Parse(ui_oughtamount.Text), false);
                obj.SetPropertyValue("extrazjfee", double.Parse(go.GetPropertyValue("extrazjfee").ToString()), false);
                obj.SetPropertyValue("newextrazjfee", double.Parse(ui_f_extraprices.Text), false);
                obj.SetPropertyValue("f_fee", double.Parse(go.GetPropertyValue("f_fee").ToString()), false);
                obj.SetPropertyValue("f_newfee", double.Parse(ui_f_fee.Text), false);
                obj.SetPropertyValue("f_jianshuiliang", double.Parse(ui_jianamount.Text), false);
                obj.SetPropertyValue("f_handplanoperator", ui_handplanoperator.Text, false);
                obj.SetPropertyValue("f_handplandate", ui_handplandate.SelectedDate, false);
                obj.Name = "t_yongshuiliang";
                obj.Save();
            }
            catch (Exception a)
            {
                MessageBox.Show(a.Message);
            }
            //取表具编号
            string    userid  = ui_userid.Text;
            string    id      = go.GetPropertyValue("id").ToString();
            int       pregas  = int.Parse(ui_oughtamount.Text);
            string    sql3    = "update t_extraprices set f_pregas= " + pregas + ",f_extrafee = f_extraprices*(" + pregas + ") where parentid=" + id;
            HQLAction action3 = new HQLAction();

            action3.HQL           = sql3;
            action3.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action3.Name          = "handplan1";
            action3.Invoke();

            string    sql    = "update t_handplan set oughtamount= " + pregas + ",extrazjfee =(select sum(f_extrafee) from t_extraprices where parentid='" + id + "') where id=" + id;
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "t_handplan";
            action.Invoke();

            foreach (GeneralObject ss in handlist)
            {
                string handid         = ss.GetPropertyValue("id").ToString();
                double f_stair1amount = double.Parse(ss.GetPropertyValue("f_stair1amount").ToString());
                double f_stair1fee    = double.Parse(ss.GetPropertyValue("f_stair1fee").ToString());
                double f_stair2amount = double.Parse(ss.GetPropertyValue("f_stair2amount").ToString());
                double f_stair2fee    = double.Parse(ss.GetPropertyValue("f_stair2fee").ToString());
                double f_stair3amount = double.Parse(ss.GetPropertyValue("f_stair3amount").ToString());
                double f_stair3fee    = double.Parse(ss.GetPropertyValue("f_stair3fee").ToString());
                double f_stair4amount = double.Parse(ss.GetPropertyValue("f_stair4amount").ToString());
                double f_stair4fee    = double.Parse(ss.GetPropertyValue("f_stair4fee").ToString());
                double f_allamont     = double.Parse(ss.GetPropertyValue("f_allamont").ToString());
                double oughtfee       = double.Parse(ss.GetPropertyValue("oughtfee").ToString());
                string sql2           = "update t_handplan set f_stair1amount= " + f_stair1amount + ",f_stair1fee= " + f_stair1fee +
                                        ",f_stair2amount= " + f_stair2amount + ",f_stair2fee= " + f_stair2fee +
                                        ",f_stair3amount= " + f_stair3amount + ",f_stair3fee= " + f_stair3fee +
                                        ",f_stair4amount= " + f_stair4amount + ",f_stair4fee= " + f_stair4fee +
                                        ",f_allamont= " + f_allamont + ",oughtfee= " + oughtfee + ",f_fee = extrazjfee + " + oughtfee + " where id=" + handid;
                HQLAction action2 = new HQLAction();
                action2.HQL           = sql2;
                action2.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                action2.Name          = "t_handplan";
                action2.Invoke();
            }
            //如果数据有误,页面提示
            //回调页面保存按钮功能
            BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;

            save.Invoke();
            PagedObjectList save1 = (from p in loader.Res where p.Name.Equals("personlist") select p).First() as PagedObjectList;

            save1.IsOld = true;
            updatehandplan.New();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //拿出datagrid所选数据
            GeneralObject go = FaKaUserUnits.SelectedItem as GeneralObject;
            //拿出页面数据上下文
            GeneralObject updatehandplan = FaKaUserUnit.DataContext as GeneralObject;
            //新建对象,往t_updatehandplan插入数据
            GeneralObject obj = new GeneralObject();

            try
            {
                obj.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                obj.EntityType    = "t_updatemyfaka";
                obj.SetPropertyValue("f_userid", ui_userid.Text, false);
                obj.SetPropertyValue("f_username", ui_username.Text, false);
                obj.SetPropertyValue("f_address", ui_address.Text, false);
                obj.SetPropertyValue("f_usertype", ui_usertype.Text, false);
                obj.SetPropertyValue("f_qibiaochangjia", ui_gasmetermanufacturers.Text, false);
                obj.SetPropertyValue("f_qibiaopinpai", ui_gaswatchbrand.Text, false);
                obj.SetPropertyValue("f_gaspricetype", ui_f_gaspricetype.Text, false);
                obj.SetPropertyValue("f_newpregas", decimal.Parse(ui_f_pregas.Text), false);
                obj.SetPropertyValue("f_pregas", decimal.Parse(go.GetPropertyValue("f_pregas").ToString()), false);
                obj.SetPropertyValue("f_cardfees", decimal.Parse(go.GetPropertyValue("f_cardfees").ToString()), false);
                obj.SetPropertyValue("f_newcardfees", decimal.Parse(ui_f_cardfees.Text), false);
                obj.SetPropertyValue("f_preamount", decimal.Parse(go.GetPropertyValue("f_preamount").ToString()), false);
                obj.SetPropertyValue("f_newpreamount", decimal.Parse(ui_f_preamount.Text), false);
                obj.SetPropertyValue("f_totalcost", decimal.Parse(go.GetPropertyValue("f_totalcost").ToString()), false);
                obj.SetPropertyValue("f_newtotalcost", decimal.Parse(ui_f_totalcost.Text), false);
                obj.SetPropertyValue("f_whethergivecard", go.GetPropertyValue("f_whethergivecard").ToString(), false);
                obj.SetPropertyValue("f_newwhethergivecard", ui_f_whethergivecard.Text, false);
                obj.SetPropertyValue("f_cardid", ui_f_cardid.Text, false);
                obj.SetPropertyValue("f_updatenote", ui_updatenote.Text, false);
                obj.SetPropertyValue("f_handplanoperator", ui_operator.Text, false);
                obj.SetPropertyValue("f_handplandate", ui_handplandate.SelectedDate, false);
                obj.Name = "t_updatemyfaka";
                //obj.Completed += obj_Completed;
                obj.Save();
            }
            catch (Exception a)
            {
                MessageBox.Show(a.Message);
            }


            //oughtfee shifoujiaofei f_operator f_inputtor f_zhinajindate
            string sql = "update t_myfaka set f_pregas= " + decimal.Parse(ui_f_pregas.Text) +
                         ",f_cardfees=" + decimal.Parse(ui_f_cardfees.Text) +
                         ",f_preamount=" + decimal.Parse(ui_f_preamount.Text) +
                         ",f_totalcost=" + decimal.Parse(ui_f_totalcost.Text) +
                         ",f_whethergivecard='" + ui_f_whethergivecard.Text +

                         "'  where id = " + go.GetPropertyValue("id");
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "abc";
            action.Invoke();
            //如果数据有误,页面提示
            //回调页面保存按钮功能
            //BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;
            // save.Invoke();
            PagedObjectList save1 = (from p in loader.Res where p.Name.Equals("personlist") select p).First() as PagedObjectList;

            save1.IsOld = true;
            updatehandplan.New();
        }
Exemple #28
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //拿出datagrid所选数据
            GeneralObject go = handUserUnits.SelectedItem as GeneralObject;
            //拿出页面数据上下文
            GeneralObject updatehandplan = handUserUnit.DataContext as GeneralObject;
            //新建对象,往t_updatehandplan插入数据
            GeneralObject obj = new GeneralObject();

            try
            {
                obj.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
                obj.EntityType    = "t_updatehandplan";
                obj.SetPropertyValue("f_userid", ui_userid.Text, false);
                obj.SetPropertyValue("f_username", ui_username.Text, false);
                obj.SetPropertyValue("f_address", ui_address.Text, false);
                obj.SetPropertyValue("oughtfee", decimal.Parse(go.GetPropertyValue("oughtfee").ToString()), false);
                obj.SetPropertyValue("newoughtfee", decimal.Parse(ui_oughtfee.Text), false);
                if (go.GetPropertyValue("lastinputgasnum") != null)
                {
                    obj.SetPropertyValue("lastinputgasnum", decimal.Parse(go.GetPropertyValue("lastinputgasnum").ToString()), false);
                }
                //修改后上期指数
                if (updatehandplan.GetPropertyValue("lastinputgasnum") != null)
                {
                    obj.SetPropertyValue("newlastinputgasnum", decimal.Parse(updatehandplan.GetPropertyValue("lastinputgasnum").ToString()), false);
                }

                obj.SetPropertyValue("lastrecord", decimal.Parse(go.GetPropertyValue("lastrecord").ToString()), false);
                obj.SetPropertyValue("newlastrecord", decimal.Parse(ui_lastrecord.Text), false);
                obj.SetPropertyValue("shifoujiaofei", go.GetPropertyValue("shifoujiaofei").ToString(), false);
                obj.SetPropertyValue("f_newzhinajindate", ui_zhinajindate.SelectedDate.Value, false);
                //obj.SetPropertyValue("f_zhinajindate", go.GetPropertyValue("f_zhinajindate").ToString(), false);
                obj.SetPropertyValue("newshifoujiaofei", ui_shifoujiaofei.Text, false);
                obj.SetPropertyValue("f_updatenote", ui_updatenote.Text, false);
                obj.SetPropertyValue("lastinputdate", go.GetPropertyValue("lastinputdate"), false);
                obj.SetPropertyValue("newlastinputdate", ui_lastinputdate.SelectedDate, false);
                if (go.GetPropertyValue("f_inputtor") == null)
                {
                    go.SetPropertyValue("f_inputtor", "无", false);
                }
                obj.SetPropertyValue("f_inputtor", go.GetPropertyValue("f_inputtor").ToString(), false);
                obj.SetPropertyValue("f_newinputtor", ui_inputtor.Text, false);
                obj.SetPropertyValue("oughtamount", decimal.Parse(go.GetPropertyValue("oughtamount").ToString()), false);
                obj.SetPropertyValue("newoughtamount", decimal.Parse(ui_oughtamount.Text), false);
                obj.SetPropertyValue("f_handplanoperator", ui_handplanoperator.Text, false);
                obj.SetPropertyValue("f_handplandate", ui_handplandate.SelectedDate, false);
                obj.Name = "t_updatehandplan";
                //obj.Completed += obj_Completed;
                obj.Save();
            }
            catch (Exception a)
            {
                MessageBox.Show(a.Message);
            }

            //oughtfee shifoujiaofei f_operator f_inputtor f_zhinajindate
            //拼接更新sql
            string sql = "update t_handplan set lastrecord= " + decimal.Parse(ui_lastrecord.Text) +
                         ",oughtfee=" + decimal.Parse(ui_oughtfee.Text) +
                         ",shifoujiaofei='" + ui_shifoujiaofei.Text +
                         "',f_operator='" + ui_operator.Text +
                         "',f_inputtor='" + ui_inputtor.Text +
                         "',f_zhinajindate='" + ui_zhinajindate.SelectedDate.ToString().Substring(0, 10) +
                         "',f_meterstate='" + meterstate.SelectedValue.ToString() +
                         "',oughtamount=" + decimal.Parse(ui_oughtamount.Text);

            if (updatehandplan.GetPropertyValue("lastinputgasnum") != null)
            {
                sql += ",lastinputgasnum=" + updatehandplan.GetPropertyValue("lastinputgasnum").ToString();
            }
            sql += "  where id = " + go.GetPropertyValue("id");
            HQLAction action = new HQLAction();

            action.HQL           = sql;
            action.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
            action.Name          = "abc";
            action.Invoke();
            //如果数据有误,页面提示
            //回调页面保存按钮功能
            //BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;
            // save.Invoke();
            PagedObjectList save1 = (from p in loader.Res where p.Name.Equals("personlist") select p).First() as PagedObjectList;

            save1.IsOld = true;
            updatehandplan.New();
        }