public void InitializeApp() { DS_Fwx_other = B_Fwx_other.GetList("id>=0" + common_file.common_app.yydh_select + sel_cond + " order by ddsj"); bindingSource1.DataSource = DS_Fwx_other.Tables[0]; dg_count = DS_Fwx_other.Tables[0].Rows.Count; this.dg_wx_other.AutoGenerateColumns = false; }
public static string Add_Fwx_other(DataSet DS_Fwx_other_temp, string yydh) { string s = common_file.common_app.get_failure; if (DS_Fwx_other_temp != null && DS_Fwx_other_temp.Tables[0].Rows.Count > 0) { Model.Fwx_other M_Fwx_other = new Model.Fwx_other(); BLL.Fwx_other B_Fwx_other = new BLL.Fwx_other(); string strlsbh_ds = ""; //记录总的lsbh以“,”号隔开 foreach (DataRow dr in DS_Fwx_other_temp.Tables[0].Rows) { string strLsbh = dr["lsbh"].ToString(); M_Fwx_other.yydh = dr["yydh"].ToString(); M_Fwx_other.qymc = dr["qymc"].ToString(); M_Fwx_other.lsbh = dr["lsbh"].ToString(); M_Fwx_other.fjrb = dr["fjrb"].ToString(); M_Fwx_other.fjbh = dr["fjbh"].ToString(); M_Fwx_other.ddsj = Convert.ToDateTime(dr["ddsj"].ToString()); M_Fwx_other.lksj = Convert.ToDateTime(dr["lksj"].ToString()); M_Fwx_other.bz = dr["bz"].ToString(); M_Fwx_other.zyzt = dr["zyzt"].ToString(); M_Fwx_other.czsj = Convert.ToDateTime(dr["czsj"].ToString()); M_Fwx_other.cznr = dr["cznr"].ToString(); M_Fwx_other.czy = dr["czy"].ToString(); M_Fwx_other.shsc = true; //如果有相同lsbh就修改,,然后添加。 DataSet ds = B_Fwx_other.GetList("lsbh='" + strLsbh + "'"); if (ds != null && ds.Tables[0].Rows.Count > 0) { int fid = Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString()); M_Fwx_other.id = fid; if (B_Fwx_other.Update(M_Fwx_other)) { s = common_file.common_app.get_suc; } } else { if (B_Fwx_other.Add(M_Fwx_other) > 0) { s = common_file.common_app.get_suc; } } strlsbh_ds += "'" + strLsbh + "'" + ","; //累加lsbh以“,”号相隔 } s = common_file.common_app.get_suc; //相反不相等的话就删除,防止本地删除中央服务器还没有删除lsbh not in if (strlsbh_ds.Length != 0) { strlsbh_ds = strlsbh_ds.Remove(strlsbh_ds.Length - 1, 1); string strsql = "delete from Fwx_other where lsbh not in(" + strlsbh_ds + ") and yydh='" + yydh + "'"; DbHelperSQL.ExecuteSql(strsql); s = common_file.common_app.get_suc; } } return(s); }
/// <summary> /// 门店上传散客房间到中心服务器 /// </summary> /// <returns></returns> public static int UpLoad_Qskyd_fjrb() { int i = 0; string s = common_app.get_failure; Model.Qskyd_fjrb M_Qskyd_fjrb = new Model.Qskyd_fjrb(); BLL.Qskyd_fjrb B_Qskyd_fjrb = new BLL.Qskyd_fjrb(); BLL.Fwx_other B_Fwx_other = new BLL.Fwx_other(); DataSet DS_Qskyd_fjrb = new DataSet(); DataSet DS_Fwx_other = new DataSet(); DS_Qskyd_fjrb = B_Qskyd_fjrb.GetList("1=1"); DS_Fwx_other = B_Fwx_other.GetList("1=1"); if (DS_Qskyd_fjrb != null && DS_Qskyd_fjrb.Tables[0].Rows.Count > 0) { object[] args = new object[2]; args[0] = DS_Fwx_other; args[1] = DS_Qskyd_fjrb; object result = jdgl_res_head_app.DynamicWebServiceCall.InvokeWebService(url, "Qskyd_fjrb_temp_ADD", args); if (result.ToString() == common_file.common_app.get_suc) { Common_Shsc.Updatshsc(DS_Qskyd_fjrb, "Qskyd_fjrb"); Common_Shsc.Updatshsc(DS_Fwx_other, "Fwx_other"); i += Common_Shsc.GetRowCount(DS_Qskyd_fjrb); i += Common_Shsc.GetRowCount(DS_Fwx_other); Common.AddMsg(DS_Qskyd_fjrb, "上传房间类别"); Common.AddMsg(DS_Fwx_other, "上传维修房"); } } return(i++); }