public int review(string ids, string psr = "", string iszt = "0", string ispp = "0", int kxsp = 0) { string sql = string.Format(@"update yx_T_ypdmb set ysbs=1, ysrq=getdate(),ysr='{1}',ztbs={2},ppbs={3},kxsp={4} where id IN ({0})", ids, psr, iszt, ispp, kxsp); WriteLog(sql); return(dal.ExecuteNonQuery(sql)); }
public string UpdateLoadData(string xml, string dayStart, string dayEnd) { XmlSerializer serializer = new XmlSerializer(typeof(List <CheckTime>)); // A FileStream is needed to read the XML document. XmlReader reader = XmlReader.Create(new System.IO.StringReader(xml)); List <CheckTime> AddressList = (List <CheckTime>)serializer.Deserialize(reader); int rowCount = 0; LiLanzDAL dal = new LiLanzDAL(); try { string sql = "DELETE FROM dbo.kq_T_rydkmx WHERE ChecktimeStart>=@start and ChecktimeStart<@end"; SqlParameter[] paramters = new SqlParameter[] { new SqlParameter("@start", DateTime.Parse(dayStart)), new SqlParameter("@end", DateTime.Parse(dayEnd).AddDays(1)) }; dal.ExecuteNonQuery(sql, CommandType.Text, paramters); foreach (CheckTime ch in AddressList) { if (ch.BadgeNumber.Length < 6) { ch.BadgeNumber = "000000".Substring(0, 6 - ch.BadgeNumber.Length) + ch.BadgeNumber; } sql = @" INSERT INTO dbo.kq_T_rydkmx (BadgeNumber, days, statu, ChecktimeStart, ChecktimeEnd, LateMinutes,EarlyMinutes) VALUES (@BadgeNumber, @days, @statu, @ChecktimeStart, @ChecktimeEnd, @LateMinutes, @EarlyMinutes);"; paramters = new SqlParameter[] { new SqlParameter("@BadgeNumber", ch.BadgeNumber), new SqlParameter("@days", Decimal.Parse(ch.days)), new SqlParameter("@statu", int.Parse(ch.statu)), new SqlParameter("@ChecktimeStart", DateTime.Parse(ch.ChecktimeStart)), new SqlParameter("@ChecktimeEnd", DateTime.Parse(ch.ChecktimeEnd)), new SqlParameter("@LateMinutes", int.Parse(ch.LateMinutes)), new SqlParameter("@EarlyMinutes", int.Parse(ch.EarlyMinutes)) }; if (dal.ExecuteNonQuery(sql, CommandType.Text, paramters) > 0) { rowCount++; } } } catch (Exception ex) { return(ex.ToString()); } return(rowCount.ToString()); }
public string UploadFile(byte[] photo, int zlmxid, int type) { string fileName = GetFileName() + ".jpg"; //设置文件保存虚拟路径 string urlPath = "../MyUpload/" + DateTime.Now.ToString("yyyyMM") + "/"; //设置文件保存物理路径 string filePath = Server.MapPath("") + "\\MyUpload\\" + DateTime.Now.ToString("yyyyMM"); //检查是否有该路径 没有就创建 if (!System.IO.Directory.Exists(filePath)) { System.IO.Directory.CreateDirectory(filePath); } writeByteArrayToFile(Path.Combine(filePath, fileName), photo); string comm = String.Format(@"INSERT INTO t_uploadfile (tableid,groupName,groupid,urladdress,CREATEdate,filename) select {0},'{2}',1003,'{1}',GETDATE(),yphh from yf_t_cpkfsjtg where tplx='sjtg' and zlmxid={0}", zlmxid, urlPath + fileName, ArrayFileType[type]); dal.ExecuteNonQuery(comm); return("done"); }