本文整理汇总了C#中Com.Aote.ObjectTools.GeneralObject.SetPropertyValue方法的典型用法代码示例。如果您正苦于以下问题:C# GeneralObject.SetPropertyValue方法的具体用法?C# GeneralObject.SetPropertyValue怎么用?C# GeneralObject.SetPropertyValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Com.Aote.ObjectTools.GeneralObject
的用法示例。
在下文中一共展示了GeneralObject.SetPropertyValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dansearch_DownloadStringCompleted
void dansearch_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
//有错误
if (e.Error != null)
{
MessageBox.Show(e.Error.Message);
}
else
{
//把数据转换成JSON
JsonObject obj = JsonValue.Parse(e.Result) as JsonObject;
JsonArray items = obj["rows"] as JsonArray;
daninfos.ItemsSource = list;
if (list.Size != 0)
list.Clear();
foreach (JsonObject json in items)
{
GeneralObject go = new GeneralObject();
try
{
go.EntityType = "t_";
go.SetPropertyValue("id", json["id"], false);//用户编号
go.SetPropertyValue("remote_key", json["remote_key"], false);//用户编号
go.SetPropertyValue("terminal_code", json["terminal_code"], false);//用户编号
go.SetPropertyValue("meter_code", json["meter_code"], false);//用户编号
go.SetPropertyValue("operate_type", json["operate_type"], false);//用户编号
go.SetPropertyValue("send_data", json["send_data"], false);//用户编号
go.SetPropertyValue("receive_data", json["receive_data"], false);//用户编号
go.SetPropertyValue("state", json["state"], false);//用户编号
go.SetPropertyValue("result", json["result"], false);//用户编号
go.SetPropertyValue("operator1",json["operator"], false);//用户编号
go.SetPropertyValue("des", json["des"], false);//用户编号
go.SetPropertyValue("create_date", json["create_date"], false);//用户编号
go.SetPropertyValue("company_code", json["company_code"], false);//用户编号
go.SetPropertyValue("telecomm_address", json["telecomm_address"], false);//用户编号
go.SetPropertyValue("customer_code",json["customer_code"], false);//用户编号
list.Add(go);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}
}
}
}
示例2: CreateObj
//创建发票对象
public GeneralObject CreateObj(GeneralObject source,double no)
{
GeneralObject go = new GeneralObject();
go.EntityType = EntityType;
string value = no.ToString();
if (value.Length != BeginNo.ToString().Length)
{
for (int i = 0; i <= BeginNo.ToString().Length-value.Length; i++)
{
value = "0" + value;
}
}
//发票号
go.SetPropertyValue("f_invoicenum", value, true);
//所属公司
go.SetPropertyValue("f_filiale", source.GetPropertyValue("f_filiale"), true);
//发票状态
go.SetPropertyValue("f_fapiaostatue", "未用", true);
//使用人
go.SetPropertyValue("f_sgoperator", source.GetPropertyValue("f_sgoperator"), true);
//分配人
go.SetPropertyValue("f_operator", source.GetPropertyValue("f_operator"), true);
//分配日期
go.SetPropertyValue("f_date", source.GetPropertyValue("f_date"), true);
return go;
}
示例3: PathListBox_SelectionChanged
private void PathListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
PathListBox pathListBox = sender as PathListBox;
if (selectObj != null)
{
selectObj.SetPropertyValue("childsShow", "Collapsed", false);
}
selectObj = pathListBox.SelectedItem as GeneralObject;
if (selectObj != null)
{
selectObj.SetPropertyValue("childsShow", "Visible", false);
}
}
示例4: userfiles_DownloadStringCompleted
void userfiles_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
kbsellgasbusy.IsBusy = false;
busy.IsBusy = false;
if (e.Error != null)
{
MessageBox.Show("未找到用户的表具信息,请去表具建档!");
return;
}
//把数据转换成JSON
JsonObject item = JsonValue.Parse(e.Result) as JsonObject;
//把用户数据写到交费界面上
ui_username.Text = (string)item["f_username"];
ui_usertype.Text = (String)item["f_usertype"];
ui_districtname.Text = (String)item["f_districtname"];
ui_gasproperties.Text = (String)item["f_gasproperties"];
ui_stairpricetype.Text = (String)item["f_stairtype"];
// zhye.Text = item["f_zhye"].ToString();
ui_address.Text = (String)item["f_address"];
//ui_gaspricetype.Text = (String)item["f_gaspricetype"];
ui_userid.Text = item["infoid"].ToString();
//zhe.Text=item["f_zherownum"].ToString();
//ui_dibaohu.IsChecked = item["f_dibaohu"].ToString().Equals("1");
//ui_userstate.Text = (String)item["f_userstate"];
// ui_paytype.Text = (String)item["f_payment"];
// ui_gasprice.Text = item["f_gasprice"].ToString();
//把欠费数据插入到欠费表中
BaseObjectList list = dataGrid1.ItemsSource as BaseObjectList;
if (list != null)
{
list.Clear();
}
// 当前正在处理的表号
String currentId = "";
// 总的上期指数
decimal lastnum = 0;
// 总气量
decimal gasSum = 0;
// 总气费
decimal feeSum = 0;
//总的滞纳金
decimal zhinajinAll = 0;
//余额
decimal f_zhye = decimal.Parse(item["f_zhye"].ToString());
JsonArray bills = item["f_hands"] as JsonArray;
foreach (JsonObject json in bills)
{
GeneralObject go = new GeneralObject();
go.EntityType = "t_handplan";
//默认选中
go.IsChecked=true;
//上期指数
decimal lastinputgasnum = (decimal)json["lastinputgasnum"];
go.SetPropertyValue("lastinputgasnum", lastinputgasnum, false);
string f_userid = (string)json["f_userid"];
go.SetPropertyValue("f_userid", f_userid, false);
// 如果表号变了
if (!f_userid.Equals(currentId))
{
currentId = f_userid;
lastnum += lastinputgasnum;
}
//计算总金额
decimal oughtfee = (decimal)json["oughtfee"];
go.SetPropertyValue("oughtfee", oughtfee, false);
feeSum += oughtfee;
// 计算总气量
decimal oughtamount = (decimal)json["oughtamount"];
gasSum += oughtamount;
go.SetPropertyValue("oughtamount", oughtamount, false);
//计算总滞纳金
decimal f_zhinajin = (decimal)json["f_zhinajin"];
zhinajinAll += f_zhinajin;
go.SetPropertyValue("f_zhinajin", f_zhinajin, false);
int id = Int32.Parse(json["id"] + "");
go.SetPropertyValue("id", id, false);
go.SetPropertyValue("lastinputdate", DateTime.Parse(json["lastinputdate"]), false);
go.SetPropertyValue("lastrecord", (decimal)json["lastrecord"], false);
go.SetPropertyValue("f_endjfdate", DateTime.Parse(json["f_endjfdate"]), false);
go.SetPropertyValue("f_zhinajintianshu", (int)json["days"], false);
go.SetPropertyValue("f_network", (string)json["f_network"], false);
go.SetPropertyValue("f_operator", (string)json["f_operator"], false);
go.SetPropertyValue("f_inputdate", DateTime.Parse(json["f_inputdate"]), false);
go.SetPropertyValue("f_userid", (string)json["f_userid"], false);
go.SetPropertyValue("f_stair1amount", (decimal)json["f_stair1amount"], false);
go.SetPropertyValue("f_stair1price", (decimal)json["f_stair1price"], false);
go.SetPropertyValue("f_stair1fee", (decimal)json["f_stair1fee"], false);
go.SetPropertyValue("f_stair2amount", (decimal)json["f_stair2amount"], false);
go.SetPropertyValue("f_stair2price", (decimal)json["f_stair2price"], false);
go.SetPropertyValue("f_stair2fee", (decimal)json["f_stair2fee"], false);
go.SetPropertyValue("f_stair3amount", (decimal)json["f_stair3amount"], false);
//.........这里部分代码省略.........
示例5: 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();
}
示例6: 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;
}
}
示例7: 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();
}
示例8: Invoke
//生成用气地址列表
public void Invoke()
{
State = State.StartLoad;
this.isBusy = true;
//楼号
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);
ObjectList plans = new ObjectList();
plans.WebClientInfo = this.WebClientInfo;
plans.Name = Guid.NewGuid().ToString();
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);
//设置楼号,有模式,按模式设置
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";
plans.Add(go);
}
}
}
}
plans.Completed += plans_Completed;
plans.Save();
}
示例9: PostUITask
private void PostUITask(GeneralObject go)
{
if (go.GetPropertyValue("CONDITION").ToString().Equals("正常"))
{
//供暖方式
ObjectCollection oc = this.Resources["WARM"] as ObjectCollection;
bool found = false;
foreach (Pair pair in oc)
{
if (pair.CName.Equals(go.GetPropertyValue("WARM").ToString()))
{
found = true;
WARM.SelectedItem = pair;
}
}
if (!found)
{
WARM_OTHER.Text = go.GetPropertyValue("WARM").ToString();
WARM.SelectedIndex = oc.Count - 1;
}
//基表厂家型号
oc = this.Resources["JB_METER_NAME"] as ObjectCollection;
found = false;
foreach (Pair pair in oc)
{
if (pair.CName.Equals(go.GetPropertyValue("JB_METER_NAME").ToString()))
{
JB_METER_NAME.SelectedItem = pair;
found = true;
}
}
if (!found)
{
JB_METER_NAME_OTHER.Text = go.GetPropertyValue("JB_METER_NAME").ToString();
JB_METER_NAME.SelectedIndex = oc.Count - 1;
}
//IC卡表厂家型号
oc = this.Resources["IC_METER_NAME"] as ObjectCollection;
found = false;
foreach (Pair pair in oc)
{
if (pair.CName.Equals(go.GetPropertyValue("IC_METER_NAME").ToString()))
{
found = true;
IC_METER_NAME.SelectedItem = pair;
}
}
if (!found)
{
IC_METER_NAME_OTHER.Text = go.GetPropertyValue("IC_METER_NAME").ToString();
go.SetPropertyValue("IC_METER_NAME", (oc.ElementAt(oc.Count - 1) as Pair).Code, true, true);
IC_METER_NAME.SelectedIndex = oc.Count - 1;
}
ObjectList lines = go.GetPropertyValue("LINES") as ObjectList;
//不存在隐患
if (lines == null)
return;
foreach (GeneralObject line in lines)
{
String EQUIPMENT = line.GetPropertyValue("EQUIPMENT") as string;
String CONTENT = line.GetPropertyValue("CONTENT") as string;
if (EQUIPMENT.Equals("安全隐患"))
CheckCheckBox(CONTENT, precautionCheckPane);
else if (EQUIPMENT.Equals("燃气表"))
CheckCheckBox(CONTENT, MeterDefectsPane);
else if (EQUIPMENT.Equals("立管"))
CheckPlumbingBox(CONTENT, PlumbingDefectsPane);
else if (EQUIPMENT.Equals("阀门表前阀"))
CheckCheckBox(CONTENT, PlumbingMeterValvePane);
else if (EQUIPMENT.Equals("阀门灶前阀"))
CheckCheckBox(CONTENT, PlumbingCookerValvePane);
else if (EQUIPMENT.Equals("阀门自闭阀"))
CheckCheckBox(CONTENT, PlumbingAutomaticValvePane);
else if (EQUIPMENT.Equals("户内管"))
CheckCheckBox(CONTENT, PlumbingPipePane);
else if (EQUIPMENT.Equals("灶具软管"))
CheckCheckBox(CONTENT, CookerPipePane);
else if (EQUIPMENT.Equals("热水器软管"))
CheckCheckBox(CONTENT, BoilerPipePane);
else if (EQUIPMENT.Equals("热水器安全隐患"))
CheckCheckBox(CONTENT, BoilerDefectsPane);
else if (EQUIPMENT.Equals("壁挂锅炉安全隐患"))
CheckCheckBox(CONTENT, WHEDefectsPane);
}
//提取用户档案地址
String card_id = go.GetPropertyValue("CARD_ID") as string;
if (IsNullOrEmpty(card_id))
return;
WebClient wc = new WebClient();
wc.DownloadStringCompleted += wc_GetUserProfileCompleted;
wc.DownloadStringAsync(new Uri(go.WebClientInfo.BaseAddress + "/one/from T_IC_USERFILE where CARD_ID='" + card_id + "'"));
}
}
示例10: Button_Click
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);
//.........这里部分代码省略.........
示例11: menus_MouseLeftButtonUp
private void menus_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
PathListBox pathListBox = sender as PathListBox;
if (selectObj != null)
{
selectObj.SetPropertyValue("childsShow", "Collapsed", false);
}
selectObj = pathListBox.SelectedItem as GeneralObject;
if (selectObj != null)
{
selectObj.SetPropertyValue("childsShow", "Visible", false);
}
}
示例12: 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);
//.........这里部分代码省略.........
示例13: 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();
}
示例14: 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();
}
示例15: 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;
}
}