Invoke() public method

动作的执行过程,首先调用获取执行语句的方法获得后台服务所需Json格式的语句。 然后把这个执行语句发送到统一的批量数据执行服务上,执行后台数据库操作。
public Invoke ( ) : void
return void
コード例 #1
0
 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();
 }
コード例 #2
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("请记录用户情况,联系管理员");
     }
 }
コード例 #3
0
        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();
            
        }
コード例 #4
0
ファイル: HQLAction.cs プロジェクト: MRZHANG1992/restV2
        private static void OnCanSaveChanged(DependencyObject dp, DependencyPropertyChangedEventArgs args)
        {
            HQLAction bea = (HQLAction)dp;

            if (bea.CanSave)
            {
                bea.Invoke();
            }
            bea.CanSave = false;
        }
コード例 #5
0
 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();
 }
コード例 #6
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();
 }
コード例 #7
0
 private void action_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
 {
     string sql = "update t_userfiles set f_initcardsellgas = null,f_gasmeterstyle='"
     + f_newgasmeterstyle.Text + "',f_gasmetermanufacturers='" + f_newgasmetermanufacturers.Text +
     "',f_metertype='" + f_qbnumber.Text + "',f_gaswatchbrand='" + CoboxPinpai.Text +
     "' where id=" + ui_id.Text;
     HQLAction action1 = new HQLAction();
     action1.HQL = sql;
     action1.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
     action1.Name = "t_changmeter";
     action1.Completed += action_Completed1;
     action1.Invoke();
 }
コード例 #8
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();

        }
コード例 #9
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 = "开启";
        }
コード例 #10
0
        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();
            }
        }
コード例 #11
0
 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();
 }
コード例 #12
0
        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();
        }
コード例 #13
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){
     }
 }
コード例 #14
0
 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;
     }
 }
コード例 #15
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();
        }
コード例 #16
0
        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_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();
        }
コード例 #17
0
 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.Name = "t_stairprice";
             obj.Completed += obj_Completed;
             obj.Save();
         }
         else
         {
             MessageBox.Show("请输入完整信息!");
             return;
         }
     }
 }
コード例 #18
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_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();
        }
コード例 #19
0
        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();
        }
コード例 #20
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;
     }
 }