예제 #1
0
        void kbfe_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            BatchExcuteAction action = (from p in PageResourceLoad.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;

            action.Invoke();
            changebusy.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();
        }
        void save_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            busy.IsBusy = true;

            BatchExcuteAction save = sender as BatchExcuteAction;

            save.Completed -= save_Completed;

            //取出登陆用户id,后台根据id查找登陆用户放入分公司等信息
            GeneralObject loginUser = (GeneralObject)FrameworkElementExtension.FindResource(this, "LoginUser");

            if (loginUser == null)
            {
                MessageBox.Show("无法获取当前登陆用户信息,请重新登陆后操作!");
                return;
            }
            string loginid = (string)loginUser.GetPropertyValue("id");
            //获取基础地址
            WebClientInfo wci = (WebClientInfo)Application.Current.Resources["server"];
            // 提交
            string    str    = wci.BaseAddress + "/sell/" + userid + "/" + id + "/" + loginid;
            Uri       uri    = new Uri(str);
            WebClient client = new WebClient();

            client.DownloadStringCompleted += client_DownloadStringCompleted;
            client.DownloadStringAsync(uri);
        }
        private void print_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            GeneralObject     kbfee = (GeneralObject)(from r in loader.Res where r.Name.Equals("kbfee") select r).First();
            BatchExcuteAction save  = (from p in loader.Res where p.Name.Equals("SaveAction111") select p).First() as BatchExcuteAction;

            save.Invoke();
            kbfee.New();
            busy.IsBusy = false;
        }
        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();
        }
예제 #6
0
        private void save_Click(object sender, RoutedEventArgs e)
        {
            ui_userfiles.IsBusy = true;
            jsontb = "[{customer_code:\"" + ur_userid.Text + "\"}]";
            jsonjs = "[{userid:" + ur_userid.Text + ",reading:" + lastinputgasnum_cb.Text + ",lastreading:" + lastinputgasnum.Text + "}]";
            url    = "/handcharge/record/batch/" + ui_handdate.SelectedDate + "/" + ui_sgnetwork.Text + "/" + ui_sgoperator.Text + "/" + chaobiaoriqi.SelectedDate + "/" + meter.SelectedValue.ToString() + "/false" + "?uuid=" + System.Guid.NewGuid().ToString();
            BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("CreateHandplan") select p).First() as BatchExcuteAction;

            save.Completed += save_Completed;
            save.Invoke();
        }
예제 #7
0
        void client1_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
        {
            WebClient client1 = sender as WebClient;

            client1.UploadStringCompleted -= client1_UploadStringCompleted;

            BatchExcuteAction save1 = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;

            save1.Completed += save1_Completed;
            save1.Invoke();
        }
예제 #8
0
        private void save_Click(object sender, RoutedEventArgs e)
        {
            ui_apply.IsBusy = true;

            GeneralObject obj = apply.DataContext as GeneralObject;

            userid = obj.GetPropertyValue("f_userid") + "";

            BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;

            save.Completed += save_Completed;
            save.Invoke();
        }
예제 #9
0
        void save1_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            BatchExcuteAction c = sender as BatchExcuteAction;

            c.Completed -= save_Completed;
            //同步 将产生的json串送后台服务进行处理
            WebClientInfo wci    = Application.Current.Resources["server"] as WebClientInfo;
            string        uri    = wci.BaseAddress + "/iesgas/user/comand";
            WebClient     client = new WebClient();

            client.UploadStringCompleted += client_UploadStringCompleted;
            client.UploadStringAsync(new Uri(uri), jsontb);
        }
        void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            //busy.IsBusy = false;
            WebClient client = sender as WebClient;

            client.DownloadStringCompleted -= client_DownloadStringCompleted;

            // 没有出错
            if (e.Error == null)
            {
                try
                {
                    String retid = e.Result as String;
                    if (!"noid".Equals(retid) && userid != null)
                    {
                        //产生要发送后台的JSON串
                        WebClientInfo wci1    = Application.Current.Resources["server"] as WebClientInfo;
                        string        uri1    = wci1.BaseAddress + "/iesgas/gascz/comand";
                        WebClient     client1 = new WebClient();
                        client1.UploadStringCompleted += client1_UploadStringCompleted;
                        client1.UploadStringAsync(new Uri(uri1), ("[{customer_code:\"" + userid + "\",id:\"" + retid + "\"}]"));
                    }
                }
                catch (Exception ex) { }
                // 调用打印
                MessageBoxResult mbr = MessageBox.Show("是否打印", "提示", MessageBoxButton.OKCancel);
                if (mbr == MessageBoxResult.OK)
                {
                    print1.Print();
                    print1.Completed += print_Completed;
                }
                else
                {
                    GeneralObject     kbfee = (GeneralObject)(from r in loader.Res where r.Name.Equals("kbfee") select r).First();
                    BatchExcuteAction save  = (from p in loader.Res where p.Name.Equals("SaveAction111") select p).First() as BatchExcuteAction;
                    save.Invoke();
                    kbfee.New();
                    busy.IsBusy = false;
                }
            }
            else
            {
                // 提示出错
                MessageBox.Show("连接服务器失败,请重试!如果继续失败,请联系系统管理员。");
                // 清除界面数据
                GeneralObject kbfee = (GeneralObject)(from r in loader.Res where r.Name.Equals("kbfee") select r).First();
                kbfee.New();
                busy.IsBusy = false;
            }
        }
예제 #11
0
        void save_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            BatchExcuteAction c = sender as BatchExcuteAction;

            c.Completed -= save_Completed;

            //计算抄表费用
            WebClientInfo wci1    = Application.Current.Resources["server"] as WebClientInfo;
            string        uri1    = wci1.BaseAddress + url;
            WebClient     client1 = new WebClient();

            client1.UploadStringCompleted += client1_UploadStringCompleted;
            client1.UploadStringAsync(new Uri(uri1), jsonjs);
        }
예제 #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();
        }
        // 提交数据到后台服务器
        private void SaveClick(object sender, RoutedEventArgs e)
        {
            //取出登陆用户id,后台根据id查找登陆用户放入分公司等信息
            GeneralObject kbfee = cbgasmanege.DataContext as GeneralObject;

            userid            = kbfee.GetPropertyValue("f_userid") + "";
            f_deliverydate_tb = kbfee.GetPropertyValue("f_deliverydate_tb") + "";
            f_grossproceeds   = kbfee.GetPropertyValue("f_grossproceeds") + "";
            f_sgoperator      = kbfee.GetPropertyValue("f_sgoperator") + "";
            f_payfeetype      = kbfee.GetPropertyValue("f_payfeetype") + "";
            BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;

            save.Invoke();
            save.Completed += save_Completed;
        }
        void save_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            BatchExcuteAction save = sender as BatchExcuteAction;

            save.Completed -= save_Completed;

            //产生要发送后台的JSON串
            WebClientInfo wci1    = Application.Current.Resources["server"] as WebClientInfo;
            string        uri1    = wci1.BaseAddress + "/iesgas/gasbk/comand";
            WebClient     client1 = new WebClient();

            client1.UploadStringCompleted += client1_UploadStringCompleted;
            client1.UploadStringAsync(new Uri(uri1), ("[{customer_code:\"" + userid +
                                                      "\",f_deliverydate_tb:\"" + f_deliverydate_tb +
                                                      "\",f_grossproceeds:\"" + f_grossproceeds +
                                                      "\",f_sgoperator:\"" + f_sgoperator +
                                                      "\",f_payfeetype:\"" + f_payfeetype +
                                                      "\"}]"));
        }
예제 #15
0
        void save_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            BatchExcuteAction save = sender as BatchExcuteAction;

            save.Completed -= save_Completed;

            if (userid != null)
            {
                //将产生的json串送后台服务进行处理
                WebClientInfo wci    = Application.Current.Resources["server"] as WebClientInfo;
                string        uri    = wci.BaseAddress + "/iesgas/user/comand";
                WebClient     client = new WebClient();
                client.UploadStringCompleted += client_UploadStringCompleted;
                client.UploadStringAsync(new Uri(uri), "[{customer_code:\"" + userid + "\"}]");
            }
            else
            {
                ui_apply.IsBusy = false;
            }
        }
예제 #16
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();
        }
        private void cardid1_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            BatchExcuteAction saves = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;
            GeneralObject     go    = (GeneralObject)(from r in loader.Res where r.Name.Equals("sellgasobj") select r).First();
            GeneralObject     faka  = (GeneralObject)(from r in loader.Res where r.Name.Equals("userfilego") select r).First();

            if (go.GetPropertyValue("f_preamount").ToString() == null || go.GetPropertyValue("f_preamount").ToString() == "" ||
                go.GetPropertyValue("f_grossproceeds").ToString() == null || go.GetPropertyValue("f_grossproceeds").ToString() == "" ||
                go.GetPropertyValue("f_totalcost").ToString() == null || go.GetPropertyValue("f_totalcost").ToString() == "" ||
                go.GetPropertyValue("f_cardid").ToString() == null || go.GetPropertyValue("f_cardid").ToString() == "")
            {
                MessageBox.Show("无法获取到阶梯信息,请重新操作!");
                return;
            }
            else
            {
                //saves.Completed += save_Completed;
                saves.Invoke();

                //CanSave="{m:Exp Str='cardid1.State \=\= $Loaded$ and sellgasobj.f_cardid !\= null and userfiles1.f_cardid !\=null and userfilego.f_cardidjia !\=null and sellgasobj.f_cardid !\= $$ and userfiles1.f_cardid !\=$$'}"
            }
        }
예제 #18
0
        void save_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            BatchExcuteAction save = sender as BatchExcuteAction;

            save.Completed -= save_Completed;
            // 界面的表号、终端名称、标记电话,清空
            terminal_namechange.Text  = "";
            meter_phonechange.Text    = "";
            ui_meternumberchange.Text = "";
            if (userid != null)
            {
                //将产生的json串送后台服务进行处理
                WebClientInfo wci    = Application.Current.Resources["server"] as WebClientInfo;
                string        uri    = wci.BaseAddress + "/iesgas/user/comand";
                WebClient     client = new WebClient();
                client.UploadStringCompleted += client_UploadStringCompleted;
                client.UploadStringAsync(new Uri(uri), "[{customer_code:\"" + userid + "\"}]");
            }
            else
            {
                ui_userfileschange.IsBusy = false;
            }
        }
        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) +
            //    "',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();
        }
예제 #20
0
        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();
        }
예제 #21
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_userinfoid", ui_userinfoid.Text, false);
                obj.SetPropertyValue("f_userid", ui_userid.Text, false);
                obj.SetPropertyValue("f_username", ui_username.Text, false);
                obj.SetPropertyValue("f_address", ui_address.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("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.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();
            PagedObjectList save1 = (from p in loader.Res where p.Name.Equals("personlist") select p).First() as PagedObjectList;

            save1.IsOld = true;
            updatehandplan.New();
        }
        private void insertsell_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            BatchExcuteAction save = (from p in loader.Res where p.Name.Equals("SaveAction") select p).First() as BatchExcuteAction;

            save.Invoke();
        }