本文整理汇总了C#中Com.Aote.ObjectTools.GeneralObject.Save方法的典型用法代码示例。如果您正苦于以下问题:C# GeneralObject.Save方法的具体用法?C# GeneralObject.Save怎么用?C# GeneralObject.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Com.Aote.ObjectTools.GeneralObject
的用法示例。
在下文中一共展示了GeneralObject.Save方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button_Click
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();
}
示例2: action_Completed
private void action_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
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);
}
if (ui_gaspricetype.SelectedValue != null)
{
go.SetPropertyValue("f_gasmeterstyle", ui_gaspricetype.SelectedValue, false);
}
go.Name = "t_changestairprice";
go.Completed += obj_Completed;
go.Save();
}
else
{
MessageBox.Show("请输入阶梯气价类型!");
ui_searchBusy.IsBusy = false;
return;
}
}
示例3: Button_Click
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();
}
示例4: ui_SaveStairButton_Click
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;
}
}
}
示例5: Button_Click
//.........这里部分代码省略.........
{
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='" + ui_username.Text +
"',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();
}
示例6: Button_Click
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();
}
示例7: action_Completed
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;
}
}
示例8: Invoke
//生成用气地址列表
public void Invoke()
{
State = State.StartLoad;
//楼号
string startbuild = this.GetPropertyValue("f_startbuild") + "";
string endbuild = startbuild;
//结束楼号不为空
if (this.GetPropertyValue("f_endbuild") + "" != "")
{
endbuild = this.GetPropertyValue("f_endbuild") + "";
}
//单元
string startunit = this.GetPropertyValue("f_startunit") + "";
string endunit = startunit;
if (this.GetPropertyValue("f_endunit") + "" != "")
{
endunit = this.GetPropertyValue("f_endunit") + "";
}
//楼层
string startlayer = this.GetPropertyValue("f_startlayer") + "";
string endlayer = startlayer;
if (this.GetPropertyValue("f_endlayer") + "" != "")
{
endlayer = this.GetPropertyValue("f_endlayer") + "";
}
//房间号
string startroom = this.GetPropertyValue("f_startroom") + "";
string endroom = startroom;
if (this.GetPropertyValue("f_endroom") + "" != "")
{
endroom = this.GetPropertyValue("f_endroom") + "";
}
//楼号列表
List<string> builds = GetList(startbuild, endbuild);
List<string> units = GetList(startunit, endunit);
List<string> layers = GetList(startlayer, endlayer);
List<string> rooms = GetList(startroom, endroom);
foreach (string build in builds)
{
foreach (string unit in units)
{
foreach (string layer in layers)
{
//每层多少室
foreach (string room in rooms)
{
//设置楼号
//SetPropertyValue("f_startbuild", build, true);
//设置单元
//SetPropertyValue("f_startunit", unit, true);
//设置层
//SetPropertyValue("f_startlayer", layer, true);
//设置每层室
//SetPropertyValue("f_room", room, true);
GeneralObject go = new GeneralObject();
go.EntityType = this.EntityType;
go.WebClientInfo = this.WebClientInfo;
go.SetPropertyValue("f_road", this.GetPropertyValue("f_road") + "", true);
go.SetPropertyValue("f_districtname", this.GetPropertyValue("f_districtname") + "", true);
go.SetPropertyValue("f_area", this.GetPropertyValue("f_area") + "", true);
//设置楼号,有模式,按模式设置
string buildpattern = this.GetPropertyValue("f_buildpattern") + "";
string str = MatchPattern(build, buildpattern);
go.SetPropertyValue("f_cusDom", str, true);
//设置单元
string unitpattern = this.GetPropertyValue("f_unitpattern") + "";
str = MatchPattern(unit, unitpattern);
go.SetPropertyValue("f_cusDy", str, true);
//设置层
string layerpattern = this.GetPropertyValue("f_layerpattern") + "";
str = MatchPattern(layer, layerpattern);
go.SetPropertyValue("f_cusFloor", str, true);
//设置每层室
string roompattern = this.GetPropertyValue("f_roompattern") + "";
str = MatchPattern(room, roompattern);
go.SetPropertyValue("f_apartment", str, true);
//Change();
//string ad = this.GetPropertyValue("f_gasaddress") + "";
go.Name = "test";
go.Save();
}
}
}
}
State = State.Loaded;
}
示例9: save2_Click
//.........这里部分代码省略.........
if (f_preamount.Text != null && f_preamount.Text != "")
{
kbfe.SetPropertyValue("f_newpreamount", f_preamount.Text, false);
}
if (go.GetPropertyValue("f_grossproceeds") != null)
{
kbfe.SetPropertyValue("f_grossproceeds", go.GetPropertyValue("f_grossproceeds").ToString(), false);
}
if (f_grossproceeds.Text != null)
{
kbfe.SetPropertyValue("f_newgrossproceeds", f_grossproceeds.Text, false);
}
if (go.GetPropertyValue("f_sgoperator") != null)
{
kbfe.SetPropertyValue("f_sgoperator", go.GetPropertyValue("f_sgoperator").ToString(), false);
}
if (go.GetPropertyValue("f_oldtype") != null)
{
kbfe.SetPropertyValue("f_oldtype", go.GetPropertyValue("f_oldtype").ToString(), false);
}
if (go.GetPropertyValue("f_payfeevalid") != null)
{
kbfe.SetPropertyValue("f_payfeevalid", go.GetPropertyValue("f_payfeevalid").ToString(), false);
}
if (f_payfeevalid.SelectedValue != null)
{
kbfe.SetPropertyValue("f_newpayfeevalid", f_payfeevalid.SelectedValue, false);
}
if (go.GetPropertyValue("f_limitbuygas") != null)
{
kbfe.SetPropertyValue("f_limitbuygas", go.GetPropertyValue("f_limitbuygas").ToString(), false);
}
if (go.GetPropertyValue("f_gasprice") !=null)
{
kbfe.SetPropertyValue("f_gasprice", go.GetPropertyValue("f_gasprice").ToString(), false);
}
if(f_gasprice.Text != null && f_gasprice.Text != "")
{
kbfe.SetPropertyValue("f_newgasprice", f_gasprice.Text, false);
}
if(go.GetPropertyValue("f_repairnum")!=null)
{
kbfe.SetPropertyValue("f_repairnum", go.GetPropertyValue("f_repairnum").ToString(), false);
}
if (f_repairnum.Text != "" && f_repairnum.Text != null)
{
kbfe.SetPropertyValue("f_newrepairnum", f_repairnum.Text, false);
}
if (go.GetPropertyValue("f_amountmaintenance") != null)
{
kbfe.SetPropertyValue("f_amountmaintenance", go.GetPropertyValue("f_amountmaintenance").ToString(), false);
}
if (go.GetPropertyValue("f_totalcost") != null)
{
kbfe.SetPropertyValue("f_totalcost", go.GetPropertyValue("f_totalcost").ToString(), false);
}
if (f_totalcost.Text != "" && f_totalcost.Text != null)
{
kbfe.SetPropertyValue("f_newtotalcost", f_totalcost.Text, false);
}
if (go.GetPropertyValue("f_benqizhye") != null)
{
kbfe.SetPropertyValue("f_benqizhye", go.GetPropertyValue("f_benqizhye").ToString(), false);
}
if (f_benqizhye.Text != "" && f_benqizhye.Text != null)
{
kbfe.SetPropertyValue("f_newbenqizhye", f_benqizhye.Text, false);
}
if (go.GetPropertyValue("f_zhye")!= null)
{
kbfe.SetPropertyValue("f_zhye", go.GetPropertyValue("f_zhye").ToString(), false);
}
if (go.GetPropertyValue("f_deliverydate") != null)
{
kbfe.SetPropertyValue("f_deliverydate", Convert.ToDateTime( go.GetPropertyValue("f_deliverydate")), false);
}
if (f_deliverydate.SelectedDate != null)
{
kbfe.SetPropertyValue("f_newdeliverydate", Convert.ToDateTime( f_deliverydate.SelectedDate), false);
}
if (go.GetPropertyValue("f_deliverytime") != null)
{
kbfe.SetPropertyValue("f_deliverytime", Convert.ToDateTime(go.GetPropertyValue("f_deliverytime")), false);
}
if (f_deliverytime.GetSelectedValue() != null)
{
kbfe.SetPropertyValue("f_newdeliverytime", f_deliverytime.GetSelectedValue(), false);
}
if (f_changedate.SelectedDate != null)
{
kbfe.SetPropertyValue("f_changedate", f_changedate.SelectedDate, false);
}
kbfe.Name = "t_upkeep";
kbfe.Completed += kbfe_Completed;
kbfe.Save();
}
示例10: BtnAddChild_Click
/// <summary>
/// 添加子节点
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnAddChild_Click(object sender, RoutedEventArgs e)
{
if ((EditGrid.DataContext as SearchObject).HasErrors)
{
MessageBox.Show("请填写名称。");
return;
}
Indicator.IsBusy = true;
//查找是否重复
String newName = (EditGrid.DataContext as SearchObject).GetPropertyValue("AName").ToString();
object remark = (EditGrid.DataContext as SearchObject).GetPropertyValue("Remark");
if (remark == null)
remark = "";
bool duplicated = false;
GeneralObject curGo = curItem.Tag as GeneralObject;
int level = 0;
if(String.IsNullOrEmpty(curGo.EntityType))
level = int.Parse(curGo.GetPropertyValue("col3").ToString()) + 1;
if(level==4)
{
Indicator.IsBusy = false;
MessageBox.Show("房间下不能再添加节点!");
return;
}
String iid = "";
if (String.IsNullOrEmpty(curGo.EntityType))
iid = curGo.GetPropertyValue("col0") + "000000";
else
iid = curGo.GetPropertyValue("id").ToString().PadLeft(6,'0') + "000000";
ItemCollection ic = curItem.Items;
for (int i = 0; i < ic.Count; i++)
{
GeneralObject item = (ic[i] as TreeViewItem).Tag as GeneralObject;
if (item.GetPropertyValue("col1").ToString().Equals(newName))
duplicated = true;
String tiid = item.GetPropertyValue("col0").ToString();
if(tiid.CompareTo(iid) > 0)
{
iid = tiid;
}
}
//判断重复
if (duplicated)
{
Indicator.IsBusy = false;
MessageBox.Show("该名称已经存在。");
return;
}
iid = iid.Substring(0, iid.Length - 6) + (int.Parse(iid.Substring(iid.Length-6))+1).ToString().PadLeft(6,'0');
int rank = 1;
object pid = curGo.GetPropertyValue("col0");
if(!String.IsNullOrEmpty(curGo.EntityType))
pid = curGo.GetPropertyValue("id").ToString();
if (curItem.Items.Count != 0)
{
//计算排序号
GeneralObject go = (curItem.Items[curItem.Items.Count - 1] as TreeViewItem).Tag as GeneralObject;
rank = int.Parse(go.GetPropertyValue("col6").ToString()) + 1;
level = int.Parse(go.GetPropertyValue("col3").ToString());
}
arguments = new object[] { iid, newName, remark, rank, level, pid };
//如果是叶子,插入t_gasaddress 并保存到t_design_address
if (level == 3)
{
GeneralObject goAddress = new GeneralObject();
goAddress.EntityType = "t_gasaddress";
goAddress.WebClientInfo = App.Current.Resources["dbclient"] as WebClientInfo;
goAddress.SetPropertyValue("f_apartment", newName, false);
goAddress.SetPropertyValue("f_cusFloor", curItem.Header, false);
goAddress.SetPropertyValue("f_cusDy", curItem.GetParentTreeViewItem().Header, false);
goAddress.SetPropertyValue("f_cusDom", curItem.GetParentTreeViewItem().GetParentTreeViewItem().Header, false);
TreeViewItem residentialArea = curItem.GetParentTreeViewItem().GetParentTreeViewItem().GetParentTreeViewItem();
goAddress.SetPropertyValue("f_districtname", residentialArea.Header, false);
goAddress.SetPropertyValue("f_road", (residentialArea.Tag as GeneralObject).GetPropertyValue("f_road"), false);
goAddress.Completed += goAddress_Completed;
goAddress.Name = "asd";
goAddress.Save();
}
//只保存入t_design_address
else
{
GeneralObject address = new GeneralObject();
address.Name = "address";
address.EntityType = "t_design_address";
address.WebClientInfo = App.Current.Resources["dbclient"] as WebClientInfo;
address.SetPropertyValue("iid", arguments[0], false);
address.SetPropertyValue("name", arguments[1], false);
address.SetPropertyValue("remark", arguments[2], false);
address.SetPropertyValue("rank", arguments[3], false);
address.SetPropertyValue("level", arguments[4], false);
//.........这里部分代码省略.........
示例11: goAddress_Completed
/// <summary>
/// 保存t_gasaddress
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void goAddress_Completed(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
if(e.Error != null)
{
Indicator.IsBusy = false;
MessageBox.Show("操作失败!");
return;
}
object addressId = (sender as GeneralObject).GetPropertyValue("ID").ToString();
//IID, Name, Remark, Level, PID, ResidentialAreaName, rank, ID, addressId
//arguments = new object[] { iid, newName, remark, rank, level, pid };
GeneralObject address = new GeneralObject();
address.Name = "address";
address.EntityType = "t_design_address";
address.WebClientInfo = App.Current.Resources["dbclient"] as WebClientInfo;
address.SetPropertyValue("iid", arguments[0], false);
address.SetPropertyValue("name", arguments[1], false);
address.SetPropertyValue("remark", arguments[2], false);
address.SetPropertyValue("rank", arguments[3], false);
address.SetPropertyValue("level", arguments[4], false);
address.SetPropertyValue("pid", arguments[5], false);
address.SetPropertyValue("addressId", addressId, false);
address.SetPropertyValue("col0", arguments[0], false);
address.SetPropertyValue("col1", arguments[1], false);
address.SetPropertyValue("col2", arguments[2], false);
address.SetPropertyValue("col6", arguments[3].ToString(), false);
address.SetPropertyValue("col3", arguments[4].ToString(), false);
address.SetPropertyValue("col4", arguments[5], false);
address.SetPropertyValue("col8", addressId, false);
address.Completed += address_Completed;
address.Save();
}
示例12: SumFee
private void SumFee()
{
ui_myjb.Text = (myjbzhye - myjbqf).ToString();
ui_mykb.Text = mykbzhye.ToString();
ui_fmykb.Text = fmykbzhye.ToString();
ui_fmyjb.Text = (fmyjbzhye - fmyjbqf).ToString();
ui_sumfee.Text = ((myjbzhye - myjbqf) + mykbzhye + fmykbzhye + (fmyjbzhye - fmyjbqf)).ToString();
ui_tjdate.Text = date;
GeneralObject obj = new GeneralObject();
obj.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
obj.EntityType = "t_qianfeijieyu";
obj.SetPropertyValue("f_tjdate", date, false);
obj.SetPropertyValue("f_civiljb", myjbzhye - myjbqf, false);
obj.SetPropertyValue("f_unciviljb", fmyjbzhye - fmyjbqf, false);
obj.SetPropertyValue("f_civilkb", mykbzhye, false);
obj.SetPropertyValue("f_uncivilkb", fmykbzhye, false);
obj.SetPropertyValue("f_sumfee", (myjbzhye - myjbqf) + mykbzhye + fmykbzhye + (fmyjbzhye - fmyjbqf), false);
obj.Name = "t_qianfeijieyu";
obj.Completed += obj_Completed;
obj.Save();
}