private Hashtable getCalenderData(int year, int month) { Hashtable ht = new Hashtable(); CommTable comm1 = new CommTable(); comm1.TabName = "ZX_RCAP"; List <SearchField> list1 = new List <SearchField>(); list1.Add(new SearchField("sname", User.Identity.Name)); list1.Add(new SearchField("year(plantime)", year + "", SearchFieldType.数值型)); list1.Add(new SearchField("month(plantime)", month + "", SearchFieldType.数值型)); DataSet ds = comm1.SearchData("*", list1, "plantime"); comm1.Close(); DataTable dt = ds.Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { string ptime = DateTime.Parse(dt.Rows[i]["plantime"].ToString()).ToString("yyyy-MM-dd"); string subject = ""; if (dt.Rows[i]["subject"] != DBNull.Value) { subject = dt.Rows[i]["subject"].ToString(); } ht[ptime] = subject; } return(ht); }
private void BindData() { CommTable comm1 = new CommTable(); comm1.TabName = "ZX_RCAP"; List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("sname", User.Identity.Name)); if (Request.QueryString["time0"] != null && Request.QueryString["time0"] != String.Empty) { condition.Add(new SearchField("plantime", Request.QueryString["time0"], SearchOperator.大于等于)); } if (Request.QueryString["time1"] != null && Request.QueryString["time1"] != String.Empty) { condition.Add(new SearchField("plantime", Request.QueryString["time1"], SearchOperator.小于等于)); } DataSet ds1 = comm1.SearchData("*", condition, "plantime"); comm1.Close(); this.repeater1.DataSource = ds1; this.repeater1.DataBind(); }
//提交数据处理 void Button1_Click(object sender, EventArgs e) { String sname1 = this.sname.SelectedValue; String kind1 = this.kind.SelectedValue; string id1 = Request.QueryString["id"]; CommTable comm1 = new CommTable("U_LawZC"); Hashtable ht1 = new Hashtable(); ht1["sname"] = sname1; ht1["kind"] = kind1; ht1["dotime"] = DateTime.Now.ToString(); ht1["checkmen"] = Page.User.Identity.Name; if (String.IsNullOrEmpty(id1) == false) { List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("id", id1, SearchFieldType.数值型)); comm1.EditQuickData(condition, ht1); } else { comm1.InsertData(ht1); } comm1.Close(); Response.Redirect("FixLawGwList.aspx", true); }
//判断当前用户是否为某部门的档案管理员 public static bool IsAdminForDepart(String depart) { bool result = false; String user1 = Comm.CurUser; if (user1.ToLower() == "admin") { result = true; } else { if (String.IsNullOrEmpty(user1) == false) { CommTable com1 = new CommTable("U_DepartDangAnAdminUsers"); List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("sname", user1)); condition.Add(new SearchField("depart", depart)); DataSet ds1 = com1.SearchData("count(*)", condition); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { if (int.Parse(ds1.Tables[0].Rows[0][0].ToString()) > 0) { result = true; } } com1.Close(); } } return(result); }
//审批档案,agree为true表示同意,agree为false表示不同意 public static void ShenPiDangAn(String ID, bool agree) { CommTable com1 = new CommTable("DA_JyBill"); List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("id", ID, SearchFieldType.数值型)); DataSet ds1 = com1.SearchData("*", condition); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { DataRow dr1 = ds1.Tables[0].Rows[0]; if (agree) { dr1["status"] = "1"; } else { dr1["status"] = "0"; } dr1["checkman"] = Comm.CurUser; dr1["checktime"] = DateTime.Now.ToString(); dr1["time1"] = DateTime.Now.AddMonths(1); com1.Update(ds1); } com1.Close(); }
/// <summary> /// 得到法律顾问的资产责任人选项 /// </summary> /// <returns></returns> public static List <string> GetZerenForZc() { int total1 = 0; List <string> list1 = new List <string>(); //得到资产的所有责任人 CommTable comm1 = new CommTable("U_ZC"); DataSet ds1 = comm1.SearchData("distinct zeren", null, "zeren", -1, -1, out total1); foreach (DataRow dr1 in ds1.Tables[0].Rows) { String temp = dr1[0].ToString().Trim(); if (temp != String.Empty) { if (list1.Contains(temp) == false) { list1.Add(temp); } } } comm1.Close(); list1.Sort(); return(list1); }
//判断当前用户是否只有法律顾问 private bool isOnlyLaw() { bool result = false; CommTable tab1 = new CommTable("U_RoleUsers"); List <SearchField> list1 = new List <SearchField>(); list1.Add(new SearchField("sname", Page.User.Identity.Name)); DataSet ds1 = tab1.SearchData("role", list1); string temp1 = String.Empty; bool first = true; foreach (DataRow dr1 in ds1.Tables[0].Rows) { if (dr1[0].ToString().Trim() != String.Empty) { if (first) { temp1 = dr1[0].ToString().Trim(); first = false; } else { temp1 = temp1 + "," + dr1[0].ToString().Trim(); } } } tab1.Close(); if (temp1 == "法律顾问") { result = true; } return(result); }
//得到我负责资产包的查询结果 public DataSet GetZcBaoSearchResult2(string Bname, string bzeren) { List <SearchField> condition = new List <SearchField>(); if (Bname != "" && Bname != null) { condition.Add(new SearchField("Bname", Bname, SearchOperator.包含, SearchFieldType.字符型)); } condition.Add(new SearchField("zeren", bzeren, SearchOperator.集合, SearchFieldType.字符型)); String sql = "select * from ZcBaoView3"; DataSet ds1 = null; CommTable comm = new CommTable(); if (condition != null && condition.Count > 0) { String conditionStr = SearchField.GetSearchCondition(condition); if (String.IsNullOrEmpty(conditionStr) == false) { sql = sql + " where " + conditionStr; } } ds1 = comm.TableComm.SearchData(sql); comm.Close(); return(ds1); }
private void SetPageInfo(DateTime time0) { CommTable comm1 = new CommTable(); comm1.TabName = "ZX_RCAP"; List <SearchField> list1 = new List <SearchField>(); list1.Add(new SearchField("sname", User.Identity.Name)); list1.Add(new SearchField("year(plantime)", time0.Year + "", SearchFieldType.数值型)); list1.Add(new SearchField("month(plantime)", time0.Month + "", SearchFieldType.数值型)); list1.Add(new SearchField("day(plantime)", time0.Day + "", SearchFieldType.数值型)); Hashtable ht = comm1.SearchData(list1); if (ht != null && ht.Count > 0) { this.subject.Text = ht["subject"].ToString(); this.remark.Text = ht["remark"].ToString(); this.id.Value = ht["id"].ToString(); } else { this.Button2.Visible = false; } comm1.Close(); }
/// <summary> /// /// </summary> /// <param name="czid"></param> /// <param name="kind"></param> /// <returns></returns> private ShenPi GetYiJian(String czid, String kind) { ShenPi info1 = null; CommTable comm1 = new CommTable(); comm1.TabName = "U_ZCSP"; List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("czid", czid)); condition.Add(new SearchField("kind", kind)); condition.Add(new SearchField("pscount", "0", SearchOperator.大于)); condition.Add(new SearchField("time1 is not null", "", SearchOperator.用户定义)); DataSet ds = comm1.SearchData("top 1 zeren,PS,remark,time1", condition, "id desc"); if (ds != null && ds.Tables[0].Rows.Count > 0) { info1 = new ShenPi(); info1.Ren = ds.Tables[0].Rows[0]["zeren"].ToString(); info1.ShiJian = ds.Tables[0].Rows[0]["time1"].ToString(); String temp1 = ds.Tables[0].Rows[0]["PS"].ToString().Trim(); String temp2 = ds.Tables[0].Rows[0]["remark"].ToString().Trim(); if (temp2 != String.Empty && kind != "11" && kind != "17") { info1.YiJian = temp1 + "(" + temp2 + ")"; } else { info1.YiJian = temp1; } } comm1.Close(); return(info1); }
void Repeater3_ItemCommand(object source, RepeaterCommandEventArgs e) { String id = e.CommandArgument.ToString(); if (String.IsNullOrEmpty(id) == false) { CommTable com1 = new CommTable("DA_AJDZFile"); List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("id", id, JSJ.SysFrame.SearchFieldType.数值型)); DataSet ds1 = com1.SearchData("*", condition); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { DataRow dr1 = ds1.Tables[0].Rows[0]; String fileName = dr1["ajTrueFile"].ToString(); if (String.IsNullOrEmpty(fileName) == false) { fileName = Server.MapPath("../Common/AttachFiles/" + fileName); if (System.IO.File.Exists(fileName)) { System.IO.File.Delete(fileName); } } dr1.Delete(); com1.Update(ds1); } com1.Close(); this.BindData(); } }
/// <summary> /// 得到资产审批表的默认信息1 /// </summary> /// <param name="zcid"></param> /// <returns></returns> public Hashtable GetInfo1(String zcid) { Hashtable ht = new Hashtable(); CommTable com1 = new CommTable(); String sql = @"select zcview.num2,zcview.depart,zcview.zeren,zcview.danwei, bxhj lixi,bj benjin,hjbx zqce, bzrmc from ZcView left outer join U_zc1 on zcview.id=u_zc1.id where zcview.id=" + zcid + " and zcview.zeren='" + Comm.CurUser + "'"; //JSJ.SysFrame.Util.Print(sql); DataSet ds1 = com1.TableComm.SearchData(sql); //得到保证单位 com1.Close(); if (ds1.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds1.Tables[0].Columns.Count; i++) { String key1 = ds1.Tables[0].Columns[i].ColumnName.ToLower(); object value1 = ds1.Tables[0].Rows[0][key1]; ht.Add(key1, value1.ToString().Trim()); } } return(ht); }
/// <summary> /// 根据条件,得到选择的资产 /// </summary> /// <param name="condition"></param> /// <returns></returns> public DataSet GetSelectZcList(List <SearchField> condition) { CommTable com1 = new CommTable(); com1.TabName = "ZCView"; List <SearchField> condition1 = new List <SearchField>(); if (condition != null) { foreach (SearchField search1 in condition) { condition1.Add(search1); } } condition1.Add(new SearchField("zeren", Comm.CurUser)); /* * 增加不在资产包的条件(2010年1月2日修改 */ SearchField search2 = new SearchField("not exists (select * from u_zcbaoinfo where zcid=zcView.id)", "", SearchOperator.用户定义); condition1.Add(search2); DataSet ds = com1.SearchData("*,left(danwei,20) as danwei1", condition1, "num2"); com1.Close(); return(ds); }
protected override void OnPreRenderComplete(EventArgs e) { if (!Page.IsPostBack) { //设置档案文件 //this.Repeater2.Visible = false; String ajnum = this.num2.Text; if (String.IsNullOrEmpty(ajnum)) { ajnum = this.num2_1.Text; } if (String.IsNullOrEmpty(ajnum) == false) { CommTable com1 = new CommTable("DA_AJDZFile"); List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("ajnum", ajnum)); DataSet ds1 = com1.SearchData("*", condition); this.Repeater3.DataSource = ds1; this.Repeater3.DataBind(); com1.Close(); } } base.OnPreRenderComplete(e); }
/// <summary> /// 计算资产处置的累计支持 /// </summary> /// <param name="czid"></param> /// <returns></returns> public double GetZhiChu(String id, ZCKind kind1) { double sum1 = 0; CommTable com1 = new CommTable(); List <SearchField> condition = new List <SearchField>(); if (kind1 == ZCKind.单条资产) { com1.TabName = "CW_Pay"; condition.Add(new SearchField("zcid", id, SearchFieldType.数值型)); } else { com1.TabName = "CW_Pay1"; condition.Add(new SearchField("bid", id, SearchFieldType.数值型)); } condition.Add(new SearchField("checktime is not null", "", SearchOperator.用户定义)); String fields = @"isnull(fee1,0)+isnull(fee2,0)+isnull(fee3,0)+isnull(fee4,0) +isnull(fee5,0)+isnull(fee6,0)+isnull(fee7,0)+isnull(fee8,0) +isnull(fee9,0)+isnull(fee10,0)+isnull(fee11,0)+isnull(fee12,0) +isnull(fee13,0)+isnull(fee14,0)+isnull(fee15,0)+isnull(fee16,0) +isnull(fee17,0)+isnull(fee18,0)+isnull(fee19,0)+isnull(fee20,0) as sum0"; DataSet ds1 = com1.SearchData(fields, condition); foreach (DataRow dr in ds1.Tables[0].Rows) { sum1 = sum1 + double.Parse(dr["sum0"].ToString()); } com1.Close(); return(sum1); }
/// <summary> /// 判断时效是否建立了日志 /// </summary> /// <param name="TimeID"></param> /// <param name="TimeKind"></param> /// <returns></returns> private static bool HasLog(String TimeID, String TimeKind, String UserName) { bool has = false; CommTable comm1 = new CommTable("U_TimeLog"); List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("TimeID", TimeID, SearchFieldType.数值型)); condition.Add(new SearchField("LogUser", UserName)); if (TimeKind == "0") //月显示 { condition.Add(new SearchField("year(logtime)", DateTime.Today.Year + "", SearchFieldType.数值型)); condition.Add(new SearchField("month(logtime)", DateTime.Today.Month + "", SearchFieldType.数值型)); } else if (TimeKind == "1") //周显示 { } else //日显示 { condition.Add(new SearchField("year(logtime)", DateTime.Today.Year + "", SearchFieldType.数值型)); condition.Add(new SearchField("month(logtime)", DateTime.Today.Month + "", SearchFieldType.数值型)); condition.Add(new SearchField("day(logtime)", DateTime.Today.Day + "", SearchFieldType.数值型)); } DataSet ds1 = comm1.SearchData("*", condition); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { has = true; } comm1.Close(); return(has); }
/// <summary> /// 得到资产已处置的数量 /// </summary> /// <param name="zcid">资产ID或资产包ID</param> /// <param name="kind">类别</param> /// <returns></returns> public int GetZcCount(int zcid, ZCKind kind) { int result = 0; CommTable com1 = new CommTable(); com1.TabName = "U_Zc2"; List <SearchField> condition = new List <SearchField>(); if (kind == ZCKind.单条资产) { condition.Add(new SearchField("zcid", zcid + "", SearchFieldType.数值型)); } else { condition.Add(new SearchField("zcbid", zcid + "", SearchFieldType.数值型)); } DataSet ds1 = com1.SearchData("id", condition); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { result = ds1.Tables[0].Rows.Count; } com1.Close(); return(result); }
private void BindData() { int totalRow = 0; CommTable comm1 = new CommTable(); comm1.TabName = "ZX_QuickTalk"; List <SearchField> list1 = new List <SearchField>(); list1.Add(new SearchField("tmen", User.Identity.Name)); DataSet ds1 = comm1.SearchData("*", list1, "id desc", 1, -1, out totalRow); this.GridView1.DataSource = ds1; this.GridView1.DataBind(); //隐藏删除等控件 if (totalRow > 0) { this.info2.Visible = true; } else { this.info2.Visible = false; } //将所有的短消息设置为已读 list1.Add(new SearchField("isRead", "0")); Hashtable ht = new Hashtable(); ht["isRead"] = "1"; comm1.EditQuickData(list1, ht); comm1.Close(); }
private void BindData() { SqlParameter[] para = new SqlParameter[2]; string kind = Request.QueryString["status"]; string depart = Request.QueryString["depart"]; StringBuilder str1 = new StringBuilder(" select * from zcBaoView where 1=1 "); if (String.IsNullOrEmpty(kind) == false && kind != "00") { str1.Append(" and bstatus=@status "); para[0] = new SqlParameter("@status", kind); } else { if (kind == "00") { str1.Append(" and bstatus is null "); } } if (String.IsNullOrEmpty(depart) == false) { str1.Append(" and depart=@depart "); para[1] = new SqlParameter("@depart", depart); } CommTable comm1 = new CommTable(); DataSet ds = comm1.TableComm.SearchData(str1.ToString(), CommandType.Text, para); comm1.Close(); this.GridView1.DataSource = ds; this.GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String ajnum = Request.QueryString["ajnum"]; String danWei = Request.QueryString["danwei"]; if (String.IsNullOrEmpty(ajnum) == false || String.IsNullOrEmpty(danWei) == false) { String sql = "select DA_AJDZFile.* from DA_AJDZFile inner join u_zc "; sql = sql + " on DA_AJDZFile.ajnum=u_zc.num2 where 1=1 "; if (String.IsNullOrEmpty(ajnum) == false) { ajnum = ajnum.Replace("'", ""); sql = sql + " and ajnum='" + ajnum + "'"; } if (String.IsNullOrEmpty(danWei) == false) { danWei = danWei.Replace("'", ""); sql = sql + " and danwei like '%" + danWei + "%'"; } //Response.Write(sql); CommTable com1 = new CommTable(); DataSet ds1 = com1.TableComm.SearchData(sql); this.Repeater3.DataSource = ds1; this.Repeater3.DataBind(); com1.Close(); } } }
//写入档案日志 public static void WriteDAFileLog(String FileName, String remark) { CommTable tab1 = new CommTable("DA_AJDZFile"); List <SearchField> condition = new List <SearchField>(); SearchField search1 = new SearchField("ajTrueFile", FileName); condition.Add(search1); DataSet ds1 = tab1.SearchData("*", condition); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { DataRow dr1 = ds1.Tables[0].Rows[0]; tab1.TabName = "DA_AJDZFileSeeLog"; Hashtable ht1 = new Hashtable(); ht1["ajnum"] = dr1["ajnum"].ToString(); ht1["time0"] = DateTime.Now.ToString(); ht1["domen"] = Comm.CurUser.ToLower(); ht1["ajFile"] = dr1["ajFile"].ToString(); if (String.IsNullOrEmpty(remark) == false) { ht1["remark"] = remark; } tab1.InsertData(ht1); } tab1.Dispose(); tab1.Close(); }
void Button1_Click(object sender, EventArgs e) { try { CommTable com1 = new CommTable("CW_ShouKuanPlan"); Hashtable ht1 = new Hashtable(); if (String.IsNullOrEmpty(Request.QueryString["zcid"]) == false) { ht1["zcid"] = Request.QueryString["zcid"]; } ht1["kind"] = Request.QueryString["kind"]; ht1["pbj"] = double.Parse(this.pbj.Text); ht1["plx"] = "0"; ht1["time0"] = DateTime.Parse(this.time0.Text).ToString("yyyy-MM-dd"); ht1["remark"] = this.remark.Text; com1.InsertData(ht1); com1.Close(); if (Request.QueryString["kind"] == "0") { Response.Redirect("ZcDetail5.aspx?id=" + Request.QueryString["zcid"], true); } else { Response.Redirect("ZcBaoDetail5.aspx?id=" + Request.QueryString["zcid"], true); } } catch (Exception err) { JSJ.SysFrame.Util.alert(this.Page, "错误:数据类型输入有错,请检查!"); } }
//更新管理员 public static void UpdateAdmin(String id, String num, String depart, String sname) { if (String.IsNullOrEmpty(id)) { id = "-1"; } DataRow dr1 = null; CommTable comm1 = new CommTable("U_DepartDangAnAdminUsers"); List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("id", id, SearchFieldType.数值型)); DataSet ds1 = comm1.SearchData("*", condition); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { dr1 = ds1.Tables[0].Rows[0]; dr1["num"] = num; dr1["depart"] = depart; dr1["sname"] = sname; } else { dr1 = ds1.Tables[0].NewRow(); dr1["num"] = num; dr1["depart"] = depart; dr1["sname"] = sname; ds1.Tables[0].Rows.Add(dr1); } comm1.Update(ds1); comm1.Close(); }
protected void Button1_Click(object sender, EventArgs e) { if (this.FileUpload1.FileBytes.Length > 0) { String fileName = this.FileUpload1.FileName; String savefileName = fileName + "_" + Page.User.Identity.Name + "_" + DateTime.Now.ToString(); savefileName = PubComm.GetMd5(savefileName) + ".data"; ///////////////////////////////////////// this.FileUpload1.SaveAs(Server.MapPath("~/Common/AttachFiles/" + savefileName)); ///////////////////////////////////////// CommTable comm1 = new CommTable(); comm1.TabName = "U_CZFile"; Hashtable ht = new Hashtable(); ht["czid"] = Request["id"]; ht["FileName"] = savefileName; ht["trueName"] = fileName; comm1.InsertData(ht); comm1.Close(); Response.Redirect(Request.PathInfo, true); } else { JSJ.SysFrame.Util.alert(this.Page, "请点浏览选择一个要上传的文件!"); } }
//判断是否可以管理某档案 public static bool IsAdminForDAByID(String ajnum) { bool result = false; if (String.IsNullOrEmpty(ajnum) == false) { String sql = "SELECT U_ZC.depart FROM DA_JyBill LEFT OUTER JOIN U_ZC ON DA_JyBill.ajnum = U_ZC.num2 where ajnum = '" + ajnum.Trim() + "'"; CommTable com1 = new CommTable(); DataSet ds1 = com1.TableComm.SearchData(sql); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { String depart = ds1.Tables[0].Rows[0][0].ToString(); if (String.IsNullOrEmpty(depart) == false) { sql = "select id from U_DepartDangAnAdminUsers where depart='" + depart + "' and sname='" + Comm.CurUser + "'"; ds1.Clear(); ds1 = com1.TableComm.SearchData(sql); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { DataRow dr1 = ds1.Tables[0].Rows[0]; if (dr1[0].ToString().Trim() != String.Empty) { result = true; } } } } com1.Close(); } return(result); }
private DataSet GetData(int curpage, out int totalRow) { totalRow = 0; DataSet ds1 = new DataSet(); CommTable com1 = new CommTable("DA_AJDZFileSeeLog"); List <SearchField> condition = new List <SearchField>(); if (this.ajnum.Text.Trim() != String.Empty) { condition.Add(new SearchField("ajnum", this.ajnum.Text.Trim())); } if (this.domen.Text.Trim() != String.Empty) { condition.Add(new SearchField("domen", this.domen.Text.Trim(), SearchOperator.包含)); } String[] arr1 = new String[] { "*" }; if (condition.Count == 0) { condition = null; } ds1 = com1.SearchData(arr1, condition, "id desc", curpage, this.PageNavigator1.PageSize, out totalRow); com1.Close(); return(ds1); }
private void BindData() { string year = Request.QueryString["year"]; string month = Request.QueryString["month"]; string timeName = Request.QueryString["timename"]; SqlParameter[] para = new SqlParameter[3]; string str1 = @" select *,left(danwei,20) as danwei1 from zcView where id in ( select zcid from U_ZcTime where year(time0)=@year1 and month(time0)=@month1 and timeName=@timeName )"; para[0] = new SqlParameter("@year1", year); para[1] = new SqlParameter("@month1", month); para[2] = new SqlParameter("@timeName", timeName); CommTable comm1 = new CommTable(); DataSet ds = comm1.TableComm.SearchData(str1, CommandType.Text, para); comm1.Close(); this.GridView1.DataSource = ds; this.GridView1.DataBind(); }
/// <summary> /// 计算资产处置的累计回款 /// </summary> /// <param name="id"></param> /// <returns></returns> public double GetHuiKuan(String id, ZCKind kind1) { double sum1 = 0; CommTable com1 = new CommTable(); List <SearchField> condition = new List <SearchField>(); if (kind1 == ZCKind.单条资产) { com1.TabName = "CW_ShouKuan"; condition.Add(new SearchField("zcid", id, SearchFieldType.数值型)); } else { com1.TabName = "CW_ShouKuan1"; condition.Add(new SearchField("bid", id, SearchFieldType.数值型)); } condition.Add(new SearchField("checktime is not null", "", SearchOperator.用户定义)); DataSet ds1 = com1.SearchData("isnull(pbj,0)+isnull(plx,0) as sum0", condition); foreach (DataRow dr in ds1.Tables[0].Rows) { sum1 = sum1 + double.Parse(dr["sum0"].ToString()); } com1.Close(); return(sum1); }
private void SetData() { CommTable comm1 = new CommTable("U_LawZC"); string id1 = Request.QueryString["id"]; if (String.IsNullOrEmpty(id1) == false) { List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("id", id1, SearchFieldType.数值型)); DataSet ds1 = comm1.SearchData("*", condition); if (ds1.Tables[0].Rows.Count > 0) { DataRow dr1 = ds1.Tables[0].Rows[0]; if (this.sname.Items.FindByValue(dr1["sname"].ToString().Trim()) != null) { this.sname.SelectedValue = dr1["sname"].ToString().Trim(); } if (this.kind.Items.FindByValue(dr1["kind"].ToString().Trim()) != null) { this.kind.SelectedValue = dr1["kind"].ToString().Trim(); } } } comm1.Close(); }
//判断用户是否有部门的资产 public static bool HaveBuZC() { U_UserNameBU user1 = new U_UserNameBU(); String userName1 = user1.GetSelfAndXiaShu(Comm.CurUser); user1.Close(); bool result = false; CommTable com1 = new CommTable(); com1.TabName = "u_zc"; List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("zeren", userName1, SearchOperator.集合)); DataSet ds = com1.SearchData("count(*) count1", condition); com1.Close(); if (ds != null && ds.Tables[0].Rows.Count > 0) { if (Int32.Parse(ds.Tables[0].Rows[0][0].ToString()) > 0) { result = true; } } return(result); }