/// <summary> /// 统计销售任务总种数 /// </summary> /// <param name="customer">客户id</param> /// <returns>返回总种数</returns> public int getkinds(string customerID) { string cmdText = "select bookNum,number from V_SaleMonomer where customerID=@customerID;"; string[] param = { "@customerID" }; object[] values = { customerID }; float sltemp = 0; int zl = 0; DataTable dtcount = db.getkinds(cmdText, param, values); DataView dv = new DataView(dtcount); DataTable dttemp = dv.ToTable(true, "bookNum"); for (int i = 0; i < dttemp.Rows.Count; i++) { string bn = dttemp.Rows[i]["bookNum"].ToString(); DataRow[] dr = dtcount.Select("bookNum='" + bn + "'"); for (int j = 0; j < dr.Length; j++) { sltemp += float.Parse(dr[j]["number"].ToString().Trim()); } if (sltemp > 0) { zl++; sltemp = 0; } } return(zl); }
/// <summary> /// 统计当天种数 /// </summary> /// <returns></returns> public int getAllkinds(string dateTime, int type) { string cmdText = "select booknum,number from V_Monomer as m,T_SingleHead as s where m.type=@type and s.time like '" + dateTime + "%'"; float sltemp = 0; int zl = 0; string[] param = { "@type" }; object[] values = { type }; DataTable dtcount = db.getkinds(cmdText, param, values); DataView dv = new DataView(dtcount); DataTable dttemp = dv.ToTable(true, "bookNum"); for (int i = 0; i < dttemp.Rows.Count; i++) { string bn = dttemp.Rows[i]["bookNum"].ToString(); DataRow[] dr = dtcount.Select("bookNum='" + bn + "'"); for (int j = 0; j < dr.Length; j++) { float count = float.Parse(dr[j]["number"].ToString().Trim()); sltemp += float.Parse(dr[j]["number"].ToString().Trim()); } if (sltemp > 0) { zl++; sltemp = 0; } } return(zl); }
/// <summary> /// 获取种类数量 /// </summary> /// <param name="sellOffHeadId"></param> /// <returns></returns> public int getKinds(string sellOffHeadId) { string sql = "select bookNum,count from T_SellOffMonomer where sellOffHead=@sellOffHeadId"; string[] param = { "@sellOffHeadId" }; object[] values = { sellOffHeadId }; float sltemp = 0; int zl = 0; DataTable dt = db.getkinds(sql, param, values); DataView dv = new DataView(dt); DataTable dttemp = dv.ToTable(true, "bookNum"); for (int i = 0; i < dttemp.Rows.Count; i++) { string bnum = dttemp.Rows[i]["bookNum"].ToString(); DataRow[] dr = dt.Select("bookNum='" + bnum + "'"); for (int j = 0; j < dr.Length; j++) { sltemp += float.Parse(dr[j]["count"].ToString().Trim()); } if (sltemp > 0) { zl++; } } return(zl); }
/// <summary> /// 统计补货单头种数 /// </summary> /// <param name="rsHeadID">补货单头id</param> /// <returns></returns> public int getkinds(string rsHeadID) { string cmdText = "select bookNum,count from T_ReplenishmentMonomer where saleTaskId=@saleTaskId"; string[] param = { "@saleTaskId" }; object[] values = { rsHeadID }; float sltemp = 0; int zl = 0; DataTable dtcount = db.getkinds(cmdText, param, values); DataView dv = new DataView(dtcount); DataTable dttemp = dv.ToTable(true, "bookNum"); for (int i = 0; i < dttemp.Rows.Count; i++) { string bn = dttemp.Rows[i]["bookNum"].ToString(); DataRow[] dr = dtcount.Select("bookNum='" + bn + "'"); for (int j = 0; j < dr.Length; j++) { float count = float.Parse(dr[j]["count"].ToString().Trim()); sltemp += float.Parse(dr[j]["count"].ToString().Trim()); } if (sltemp > 0) { zl++; sltemp = 0; } } return(zl); }