private void AddFavorite(string id, string name) { if (!IsUserAlreadyLogin) { CommonMethod.ResponseAjaxContent(this.Page, "needlogin"); return; } else { RetrieveCriteria rc = new RetrieveCriteria(typeof(XiHuan_UserFavorateEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(XiHuan_UserFavorateEntity.__USERID, CurrentUserId); c.AddEqualTo(XiHuan_UserFavorateEntity.__GOODSID, id); rc.AddSelect(XiHuan_UserFavorateEntity.__ID); DataTable dt = rc.AsDataTable(); if (dt != null && dt.Rows.Count > 0) { CommonMethod.ResponseAjaxContent(this.Page, "already"); return; } else { XiHuan_UserFavorateEntity newfavorite = new XiHuan_UserFavorateEntity(); newfavorite.UserId = CurrentUserId; newfavorite.GoodsId = CommonMethod.ConvertToInt(id, 0); newfavorite.GoodsName = GlobalObject.unescape(CommonMethod.FinalString(name)); newfavorite.FacRemark = ""; newfavorite.FavDate = DateTime.Now; newfavorite.Save(); CommonMethod.ResponseAjaxContent(this.Page, "ok"); } } }
public IList<ScheduleEntity> GetCanExecute() { RetrieveCriteria rc = new RetrieveCriteria(typeof(tb_ScheduleRelistQueueEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(tb_ScheduleRelistQueueEntity.__STATE, false); c.AddLessThanOrEqualTo(tb_ScheduleRelistQueueEntity.__SCHEDULE, DateTime.Now); EntityContainer ec=rc.AsEntityContainer(); IList<ScheduleEntity> list = new List<ScheduleEntity>(); if (ec.Count > 0) { foreach (EntityObject srq in ec) { ScheduleEntity sre = new ScheduleEntity(); sre.Id = ((tb_ScheduleRelistQueueEntity)srq).id; sre.Nick = userAction.GetUserNick(((tb_ScheduleRelistQueueEntity)srq).user_id); sre.Num_iid = ((tb_ScheduleRelistQueueEntity)srq).num_iid; if (sre.Nick != "") { list.Add(sre); } } } return list; }
protected void btnUpDatePic_Click(object sender, EventArgs e) { RetrieveCriteria rcGoodsPics = new RetrieveCriteria(typeof(XiHuan_UserGoodsEntity)); rcGoodsPics.AddSelect(XiHuan_UserGoodsEntity.__DEFAULTPHOTO); rcGoodsPics.AddSelect(XiHuan_UserGoodsEntity.__NAME); rcGoodsPics.AddSelect(XiHuan_UserGoodsEntity.__DETAILURL); Condition c = rcGoodsPics.GetNewCondition(); c.AddEqualTo(XiHuan_UserGoodsEntity.__ISCHECKED, 1); c.AddNotEqualTo(XiHuan_UserGoodsEntity.__DEFAULTPHOTO, "images/none.jpg"); rcGoodsPics.OrderBy(XiHuan_UserGoodsEntity.__CREATEDATE, false); rcGoodsPics.Top = 6; EntityContainer ecGoods = rcGoodsPics.AsEntityContainer(); string pics = "var pics=\""; string links = "var links=\""; string texts = "var texts=\""; foreach (XiHuan_UserGoodsEntity goods in ecGoods) { pics += goods.DefaultPhoto.Replace(GlobalVar.DefaultPhotoSize, GlobalVar.BigPhotoSize) + "|"; links += goods.DetailUrl + "|"; texts += ValidatorHelper.SafeSql(goods.Name) + "|"; } pics = pics.TrimEnd('|') + "\";"; links = links.TrimEnd('|') + "\";"; texts = texts.TrimEnd('|') + "\";"; Query.ProcessSqlNonQuery(string.Format("update xihuan_systemconfig set configvalue='{0}' where configkey='HomeRounPics'", pics + links + texts), GlobalVar.DataBase_Name); SystemConfigFacade.Refresh(); Alert("幻灯片成功更新!"); }
private FNRETRIEVAL_STEntity GetRetrievalStation(string retrieval_station) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNRETRIEVAL_STEntity)); rc.GetNewCondition().AddEqualTo(FNRETRIEVAL_STEntity.__RETRIEVAL_STATION, retrieval_station); return((FNRETRIEVAL_STEntity)rc.AsEntity()); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id = CommonMethod.ConvertToInt(Request["id"], 0); if (id > 0) { RetrieveCriteria rcgoodimage = new RetrieveCriteria(typeof(XiHuan_GoodsImageEntity)); Condition c = rcgoodimage.GetNewCondition(); c.AddEqualTo(XiHuan_GoodsImageEntity.__GOODSID, id); rcgoodimage.AddSelect(XiHuan_GoodsImageEntity.__IMGSRC); rcgoodimage.AddSelect(XiHuan_GoodsImageEntity.__IMGDESC); rcgoodimage.OrderBy(XiHuan_GoodsImageEntity.__CREATEDATE, false); DataTable dt = rcgoodimage.AsDataTable(); StringBuilder sbImage = new StringBuilder(); StringBuilder sbDesc = new StringBuilder(); for (int i = 0; i < dt.Rows.Count; i++) { sbImage.AppendFormat("\"{0}\",", dt.Rows[i][XiHuan_GoodsImageEntity.__IMGSRC]); sbDesc.AppendFormat("\"{0}\",", dt.Rows[i][XiHuan_GoodsImageEntity.__IMGDESC]); } ExecStartupScript(string.Format("imageArray=new Array({0});", sbImage.ToString().TrimEnd(','))); ExecStartupScript(string.Format("imageDesc=new Array({0});", sbDesc.ToString().TrimEnd(','))); ExecStartupScript("getnext();$('#loadingimage').hide(); $('#saint').show();"); } } }
private void GetDetail() { RetrieveCriteria rc = new RetrieveCriteria(typeof(XiHuan_UserInfoEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(XiHuan_UserInfoEntity.__USERNAME, txtUserName.Text.Trim()); rc.AddSelect(XiHuan_UserInfoEntity.__ID); rc.AddSelect(XiHuan_UserInfoEntity.__ORIGNALPWD); rc.AddSelect(XiHuan_UserInfoEntity.__ISLOCKED); XiHuan_UserInfoEntity user = rc.AsEntity() as XiHuan_UserInfoEntity; if (user != null) { if (user.IsLocked == 0) { lblResult.Text = string.Format("密码为:<span class=\"highlight\">{0}</span>,<a href=\"###\" onclick=\"LockUser({1});\">锁定此账号</a>", user.OrignalPwd, user.ID); } if (user.IsLocked == 1) { lblResult.Text = string.Format("密码为:<span class=\"highlight\">{0}</span>,<a href=\"###\" onclick=\"UnLockUser({1});\">撤消锁定此账号</a>", user.OrignalPwd, user.ID); } } else { lblResult.Text = "<span class=\"highlight\">没有找到此会员的信息!</span>"; } }
private void InitPage() { int uid = CommonMethod.ConvertToInt(Request["Id"], 0); if (uid > 0) { #region 浏览过该换品的人 #region 浏览历史 int gid = GoodDetail.ID; if (IsUserAlreadyLogin) { RetrieveCriteria rcview = new RetrieveCriteria(typeof(XiHuan_GoodsViewUserEntity)); Condition cview = rcview.GetNewCondition(); cview.AddEqualTo(XiHuan_GoodsViewUserEntity.__GOODSID, gid); cview.AddEqualTo(XiHuan_GoodsViewUserEntity.__VISITORID, CurrentUserId); cview.AddEqualTo(XiHuan_GoodsViewUserEntity._TYPE, 1); XiHuan_GoodsViewUserEntity newview = rcview.AsEntity() as XiHuan_GoodsViewUserEntity; if (CurrentUserId != gid) { if (newview == null) { newview = new XiHuan_GoodsViewUserEntity(); newview.GoodsId = gid; newview.VisitorId = CurrentUserId; newview.VisitorName = CurrentUserName; newview.Type = 1; } newview.VisitorHeadImage = CurrentUser.HeadImage; newview.VisitDate = DateTime.Now; newview.Save(); } } #endregion #endregion StringBuilder sbSql = new StringBuilder("select top 18 Id,Name,DefaultPhoto,ViewCount,DetailUrl from XiHuan_UserGoods with(nolock) where OwnerId={0} and IsChecked=1 order by CreateDate desc, ViewCount desc ;"); sbSql.Append("select * from XiHuan_UserGoodsChangeRequire with(nolock) where OwnerId={0} order by RequireDate desc; "); sbSql.Append("select * from XiHuan_UserGoodsChangeRequire with(nolock) where SenderId={0} order by RequireDate desc; "); sbSql.Append("select * from XiHuan_GuestBook with(nolock) where ToId={0} order by CreateDate desc; "); sbSql.Append("select FriendId,FriendName from XiHuan_UserFriends with(nolock) where OwnerId={0} order by AddDate desc; "); sbSql.Append("select top 10 VisitorId,VisitorName,VisitorHeadImage,VisitDate from XiHuan_GoodsViewUser with(nolock) where Type=1 and GoodsId=" + gid + " order by VisitDate desc;"); DataSet ds = Query.ProcessMultiSql(string.Format(sbSql.ToString(), uid), GlobalVar.DataBase_Name); dlsHotGoods.DataSource = ds.Tables[0]; dlsHotGoods.DataBind(); rptSend.DataSource = ds.Tables[1]; rptSend.DataBind(); rptRequire.DataSource = ds.Tables[2]; rptRequire.DataBind(); rptUserNotes.DataSource = ds.Tables[3]; rptUserNotes.DataBind(); rptGoodFriends.DataSource = ds.Tables[4]; rptGoodFriends.DataBind(); rptVisitor.DataSource = ds.Tables[5]; rptVisitor.DataBind(); } }
private bool IsBucketExist(string bucketNo) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNZAIKOEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNZAIKOEntity.__BUCKET_NO, bucketNo); return(rc.AsEntity() != null); }
public static FNHANSOEntity GetHansoByBucketNo(string bucketNo) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNHANSOEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNHANSOEntity.__BUCKET_NO, bucketNo); return(rc.AsEntity() as FNHANSOEntity); }
public static FNRANGEEntity GetRange(string termNo) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNRANGEEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNRANGEEntity.__TERMNO, termNo); return(rc.AsEntity() as FNRANGEEntity); }
public static FNHANSOEntity GetTransData(string mcKey) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNHANSOEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNHANSOEntity.__MCKEY, mcKey); return(rc.AsEntity() as FNHANSOEntity); }
public static USERATTRIBUTEEntity GetUserAttributeByUserId(string userId) { RetrieveCriteria rc = new RetrieveCriteria(typeof(USERATTRIBUTEEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(USERATTRIBUTEEntity.__USERID, userId); return(rc.AsEntity() as USERATTRIBUTEEntity); }
public static FNLOCATEntity GetLocationBySystemid(string systemid) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNLOCATEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNLOCATEntity.__SYSTEMID, systemid); return(rc.AsEntity() as FNLOCATEntity); }
public static TERMINALEntity GetTermByIP(string ipAddress) { RetrieveCriteria rc = new RetrieveCriteria(typeof(TERMINALEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(TERMINALEntity.__IPADDRESS, ipAddress); return(rc.AsEntity() as TERMINALEntity); }
public string GetSessionKey(string nick) { RetrieveCriteria rc = new RetrieveCriteria(typeof(tb_UserEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(tb_UserEntity.__NICK, nick); tb_UserEntity user = (tb_UserEntity)rc.AsEntity(); return user.SessionKey; }
public static FNSTATIONEntity GetStation(string stNo) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNSTATIONEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNSTATIONEntity.__STNO, stNo); return(rc.AsEntity() as FNSTATIONEntity); }
public static FNZAIKOEntity GetZaiKoByTicketNo(string ticketNo) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNZAIKOEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNZAIKOEntity.__TICKET_NO, ticketNo); return(rc.AsEntity() as FNZAIKOEntity); }
private void LoadDetail() { #region 浏览过该换品的人 #region 浏览历史 int gid = CommonMethod.ConvertToInt(Request["gid"], 0); if (gid > 0) { if (IsUserAlreadyLogin) { RetrieveCriteria rcview = new RetrieveCriteria(typeof(XiHuan_GoodsViewUserEntity)); Condition cview = rcview.GetNewCondition(); cview.AddEqualTo(XiHuan_GoodsViewUserEntity.__GOODSID, gid); cview.AddEqualTo(XiHuan_GoodsViewUserEntity.__VISITORID, CurrentUserId); cview.AddEqualTo(XiHuan_GoodsViewUserEntity._TYPE, 0); XiHuan_GoodsViewUserEntity newview = rcview.AsEntity() as XiHuan_GoodsViewUserEntity; if (newview == null) { newview = new XiHuan_GoodsViewUserEntity(); newview.GoodsId = gid; newview.VisitorId = CurrentUserId; newview.VisitorName = CurrentUserName; newview.Type = 0; } newview.VisitorHeadImage = CurrentUser.HeadImage; newview.VisitDate = DateTime.Now; newview.Save(); } #endregion string sql = @"select top 10 VisitorId,VisitorName,VisitorHeadImage,VisitDate from XiHuan_GoodsViewUser with(nolock) where Type=0 and GoodsId={0} order by VisitDate desc; declare @vcount int; update xihuan_usergoods set viewcount=viewcount+1,@vcount=viewcount+1 where id= {0}; select @vcount;"; DataSet ds = Query.ProcessMultiSql(string.Format(sql, gid), GlobalVar.DataBase_Name); DataTable dt = ds.Tables[0]; DataTable dt2 = ds.Tables[1]; int viewcount = (dt2 != null && dt2.Rows.Count > 0 ? CommonMethod.ConvertToInt(dt2.Rows[0][0], 0) : 0); StringBuilder sbViewContent = new StringBuilder(); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { sbViewContent.AppendFormat("<li style=\"width: 170px; text-align: left;\"><a title=\"浏览时间{0}\" href=\"{1}\" target=\"_blank\"><img style=\"border: 0px; vertical-align: middle;\" title=\"{2}\" src=\"{3}\" width=\"50\" height=\"40\" /> {4}</a></li>", dr["VisitDate"], SrcRootPath + "xh.aspx?id=" + dr["VisitorId"], dr["VisitorName"], SrcRootPath + dr["VisitorHeadImage"], dr["VisitorName"]); } } else { CommonMethod.ResponseAjaxContent(this.Page, "尚无登录用户浏览过...$" + viewcount); return; } CommonMethod.ResponseAjaxContent(this.Page, "<ul>" + sbViewContent + "</ul>$" + viewcount); } #endregion }
public static FNRANGEEntity GetRange(string section, string line) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNRANGEEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNRANGEEntity.__MADE_SECTION, section); c.AddEqualTo(FNRANGEEntity.__MADE_LINE, line); return(rc.AsEntity() as FNRANGEEntity); }
public static FNZAIKOEntity GetZaiKoInFlatWarehouseByBucketNo(string bucketNo) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNZAIKOEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNZAIKOEntity.__BUCKET_NO, bucketNo); c.AddEqualTo(FNZAIKOEntity.__STORAGE_PLACE_FLAG, "1");//平库 return(rc.AsEntity() as FNZAIKOEntity); }
public static FNTOUCYAKUEntity GetArrivalReport(string stationNo) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNTOUCYAKUEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNTOUCYAKUEntity.__STNO, stationNo); c.AddEqualTo(FNTOUCYAKUEntity.__SYORIFLG, "1"); return(rc.AsEntity() as FNTOUCYAKUEntity); }
private void CheckeNotes() { Transaction t = new Transaction(); DataTable dt = Query.ProcessSql(@"SELECT Id,Content,ReplyContent FROM XiHuan_GuestBook WITH(nolock) WHERE IsChecked=0 ", GlobalVar.DataBase_Name); string content = string.Empty; string replycontent = string.Empty; int nid = 0; if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { nid = CommonMethod.ConvertToInt(dr["Id"], 0); content = CommonMethod.FinalString(dr["Content"]); replycontent = CommonMethod.FinalString(dr["ReplyContent"]); if (CommonMethodFacade.ValidFFZF(content).Length == 0 && CommonMethodFacade.ValidFFZF(replycontent).Length == 0) { XiHuan_GuestBookEntity notesinfo = new XiHuan_GuestBookEntity(); notesinfo.Id = nid; notesinfo.Retrieve(); if (notesinfo.IsPersistent) { notesinfo.IsChecked = 1; t.AddSaveObject(notesinfo); XiHuan_MessageEntity notechecknoticemessage = new XiHuan_MessageEntity(); notechecknoticemessage.FromId = 1; notechecknoticemessage.FromName = "喜换网"; notechecknoticemessage.ToId = notesinfo.FromId; notechecknoticemessage.ToName = notesinfo.FromName; notechecknoticemessage.Content = string.Format("尊敬的喜换网会员<strong>{0}</strong>,您好:<br/>您给\"{1}\"的留言\"{2}\",已经通过审核,请注意查看!", notesinfo.FromName, notesinfo.ToName, notesinfo.Content); notechecknoticemessage.Flag = byte.Parse(XiHuan_MessageFacade.MessageState.未读.ToString("d")); notechecknoticemessage.CreateDate = DateTime.Now; t.AddSaveObject(notechecknoticemessage); if (t.Process()) { #region 如果是对换品页面的留言,重新生成换品页 if (CommonMethod.ConvertToInt(nid, 0) > 0) { RetrieveCriteria rcgoods = new RetrieveCriteria(typeof(XiHuan_UserGoodsEntity)); rcgoods.AddSelect(XiHuan_UserGoodsEntity.__DETAILURL); Condition cgoods = rcgoods.GetNewCondition(); cgoods.AddEqualTo(XiHuan_UserGoodsEntity.__ID, notesinfo.GoodsId); cgoods.AddEqualTo(XiHuan_UserGoodsEntity.__ISCHECKED, 1); XiHuan_UserGoodsEntity goods = rcgoods.AsEntity() as XiHuan_UserGoodsEntity; if (goods != null) { CommonMethod.readAspxAndWriteHtmlSoruce("../showdetail.aspx?id=" + notesinfo.GoodsId, "../" + goods.DetailUrl); } } #endregion } } } } } }
public static FMZKEYEntity GetUnmanagedZKey(string zaikey) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FMZKEYEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FMZKEYEntity.__ZAIKEY, zaikey); c.AddEqualTo(FMZKEYEntity.__MANAGE_ITEM_FLAG, '1'); return(rc.AsEntity() as FMZKEYEntity); }
public static LOGINUSEREntity GetUser(string userId, string password) { RetrieveCriteria rc = new RetrieveCriteria(typeof(LOGINUSEREntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(LOGINUSEREntity.__USERID, userId); c.AddEqualTo(LOGINUSEREntity.__PASSWORD, password); return(rc.AsEntity() as LOGINUSEREntity); }
public static bool IsSystemOnline() { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNAREAEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNAREAEntity.__ARCNO, "1"); c.AddEqualTo(FNAREAEntity.__SYSTEMFLG, "1"); return(rc.AsEntity() != null); }
/// <summary> /// 返回某个系统选项的值 /// </summary> /// <param name="setupKey">关键字</param> /// <returns></returns> public string GetAppSetupValue(string setupKey) { RetrieveCriteria rc = new RetrieveCriteria(typeof(Entity系统选项表)); Condition c = rc.GetNewCondition(); c.AddEqualTo(Entity系统选项表.__关键字, setupKey); Entity系统选项表 ex = (Entity系统选项表)rc.AsEntity(); return(ex.值); }
public static LedMessage getLedMessageByLedNo(string ledNo, bool justStart) { RetrieveCriteria rc = new RetrieveCriteria(typeof(LedMessage)); Condition c = rc.GetNewCondition(); c.AddEqualTo(LedMessage.__LEDNO, ledNo); if (!justStart) { c.AddEqualTo(LedMessage.__PROCESSED, '0'); } return(rc.AsEntity() as LedMessage); }
private void CheckNotes(string id, string gid) { #region 留言通过审核,给留言人发送提醒短消息,提醒留言已通过审核 Transaction t = new Transaction(); XiHuan_GuestBookEntity notesinfo = new XiHuan_GuestBookEntity(); notesinfo.Id = CommonMethod.ConvertToInt(id, 0); notesinfo.Retrieve(); if (notesinfo.IsPersistent) { notesinfo.IsChecked = 1; t.AddSaveObject(notesinfo); XiHuan_MessageEntity notechecknoticemessage = new XiHuan_MessageEntity(); notechecknoticemessage.FromId = 1; notechecknoticemessage.FromName = "喜换网"; notechecknoticemessage.ToId = notesinfo.FromId; notechecknoticemessage.ToName = notesinfo.FromName; notechecknoticemessage.Content = string.Format("尊敬的喜换网会员<strong>{0}</strong>,您好:<br/>您给\"{1}\"的留言\"{2}\",已经通过审核,请注意查看!", notesinfo.FromName, notesinfo.ToName, notesinfo.Content); notechecknoticemessage.Flag = byte.Parse(XiHuan_MessageFacade.MessageState.未读.ToString("d")); notechecknoticemessage.CreateDate = DateTime.Now; t.AddSaveObject(notechecknoticemessage); } #endregion if (t.Process()) { #region 如果是对换品页面的留言,重新生成换品页 if (CommonMethod.ConvertToInt(gid, 0) > 0) { RetrieveCriteria rcgoods = new RetrieveCriteria(typeof(XiHuan_UserGoodsEntity)); rcgoods.AddSelect(XiHuan_UserGoodsEntity.__DETAILURL); Condition cgoods = rcgoods.GetNewCondition(); cgoods.AddEqualTo(XiHuan_UserGoodsEntity.__ID, gid); cgoods.AddEqualTo(XiHuan_UserGoodsEntity.__ISCHECKED, 1); XiHuan_UserGoodsEntity goods = rcgoods.AsEntity() as XiHuan_UserGoodsEntity; if (goods != null) { CommonMethod.readAspxAndWriteHtmlSoruce("../showdetail.aspx?id=" + gid, "../" + goods.DetailUrl); } } #endregion Alert("恭喜:留言审核成功!"); BindNotes(0); } else { t.RollBack(); } }
public void PrintSubdivided(List <FNLABELEntity> labels) { LabelSubdivided ls = new LabelSubdivided(); ls.TicketNo = labels[0].TICKET_NO; ls.BucketNo = labels[0].BUCKET_NO; ls.Section = labels[0].SECTION; ls.Line = labels[0].LINE; ls.PrNo = labels[0].PR_NO; ls.ItemCode = labels[0].ZAIKEY; ls.ItemName = GetItemName(ls.ItemCode); ls.ColorCode = labels[0].COLOR_CODE; decimal count = 0, weight = 0; foreach (FNLABELEntity label in labels) { count += label.RETRIEVAL_QTY; weight += label.RETRIEVAL_WEIGHT; } ls.Count = count.ToString("F0"); ls.Weight = weight.ToString(); ls.Unit = (labels[0].MASTER_UNIT_WEIGHT * 1000).ToString("F4"); ls.RetrievalNo = labels[0].RETRIEVAL_NO.Trim(); ls.NecessaryQty = labels[0].NECESSARY_QTY.ToString("F0"); ls.UserName = labels[0].USERNAME; if (labels[0].OPTION_FLAG.Equals("1")) { ls.OptionFlag = "(直行)"; } ls.StartDate = (labels[0].START_DATE.Length == 8 ? labels[0].START_DATE.Insert(4, "/").Insert(7, "/") : labels[0].START_DATE) + (labels[0].START_TIMING_FLAG == "1" ? "AM" : labels[0].START_TIMING_FLAG == "2" ? "PM" : ""); RetrieveCriteria rc = new RetrieveCriteria(typeof(FNLABELEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNLABELEntity.__LABEL_TYPE, '5'); c.AddEqualTo(FNLABELEntity.__RETRIEVAL_NO, labels[0].RETRIEVAL_NO); c.AddEqualTo(FNLABELEntity.__SERIAL_NO, labels[0].SERIAL_NO); c.AddEqualTo(FNLABELEntity.__PRINTING_FLAG, "3"); int currentPage = rc.AsEntityContainer().Count + 1; rc = new RetrieveCriteria(typeof(FNLABELEntity)); c = rc.GetNewCondition(); c.AddEqualTo(FNLABELEntity.__LABEL_TYPE, '5'); c.AddEqualTo(FNLABELEntity.__RETRIEVAL_NO, labels[0].RETRIEVAL_NO); c.AddEqualTo(FNLABELEntity.__SERIAL_NO, labels[0].SERIAL_NO); int totalPage = rc.AsEntityContainer().Count; ls.Page = string.Format("{0}/{1}", currentPage, totalPage); pc.DoPrint(GetPrintName(labels[0].PRINTER_NO), ls); }
private List <FNLABELEntity> GetNextLabel() { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNLABELEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNLABELEntity.__PRINTING_FLAG, "1"); OrGroup og = c.GetNewOrGroup(); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "11"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "12"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "13"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "14"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "15"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "16"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "17"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "18"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "19"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "20"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "21"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "22"); og.AddEqualTo(FNLABELEntity.__PRINTER_NO, "31"); rc.OrderBy(FNLABELEntity.__BUCKET_NO); rc.OrderBy(FNLABELEntity.__PRINTER_NO); rc.OrderBy(FNLABELEntity.__RETRIEVAL_STATION); rc.OrderBy(FNLABELEntity.__LINE); EntityContainer ec = rc.AsEntityContainer(); if (ec.Count > 0) { List <FNLABELEntity> labels = new List <FNLABELEntity>(); for (int i = 0; i < ec.Count; i++) { FNLABELEntity label = ec[i] as FNLABELEntity; if (i > 0) { if (label.BUCKET_NO != labels[i - 1].BUCKET_NO || label.PRINTER_NO != labels[i - 1].PRINTER_NO) { break; //不同的箱号或打印机 } } labels.Add(label); } return(labels); } else { return(null); } }
public static List <FNSIJIEntity> GetSiJis(string mckey) { RetrieveCriteria rc = new RetrieveCriteria(typeof(FNSIJIEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(FNSIJIEntity.__MCKEY, mckey); EntityContainer ec = rc.AsEntityContainer(); List <FNSIJIEntity> sijis = new List <FNSIJIEntity>(); for (int i = 0; i < ec.Count; i++) { sijis.Add(ec[i] as FNSIJIEntity); } return(sijis); }
public int GetUserIdByNick(string nick) { RetrieveCriteria rc = new RetrieveCriteria(typeof(tb_UserEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(tb_UserEntity.__NICK,nick); tb_UserEntity ue = (tb_UserEntity)rc.AsEntity(); if (ue != null) { return ue.id; } else { return 0; } }
protected void Button1_Click(object sender, EventArgs e) { //图片表还需要处理,不是默认图片的,需要将图片复制到新的路径,更新路径到数据库 RetrieveCriteria rcgimages = new RetrieveCriteria(typeof(XiHuan_GoodsImageEntity)); Condition c = rcgimages.GetNewCondition(); if (txtGoodsId.Text.Trim().Length > 0) { c.AddEqualTo(XiHuan_GoodsImageEntity.__GOODSID, txtGoodsId.Text); } rcgimages.AddSelect(XiHuan_GoodsImageEntity.__ID); rcgimages.AddSelect(XiHuan_GoodsImageEntity.__CREATEDATE); rcgimages.AddSelect(XiHuan_GoodsImageEntity.__IMGSRC); EntityContainer imagecontainer = rcgimages.AsEntityContainer(); string opath = string.Empty; string filename = string.Empty; string extention = string.Empty; string despath = string.Empty; string filepath = string.Empty; string fixpath = "images/userupload/goodsimage/"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (XiHuan_GoodsImageEntity goodsimage in imagecontainer) { opath = Server.MapPath(goodsimage.ImgSrc); filename = Path.GetFileNameWithoutExtension(opath); extention = Path.GetExtension(opath); if (File.Exists(opath)) { filepath = fixpath + goodsimage.CreateDate.Year + "/" + goodsimage.CreateDate.Month + "/" + goodsimage.CreateDate.Day + "/"; despath = Server.MapPath(filepath + filename + extention); if (!Directory.Exists(Server.MapPath(filepath))) { Directory.CreateDirectory(Server.MapPath(filepath)); } if (!File.Exists(despath)) { File.Copy(opath, despath, true);//复制原来的图片到新的路径 //File.Delete(opath); } sb.Append("Update XiHuan_GoodsImage set ImgSrc='" + filepath + filename + extention + "' WHERE Id=" + goodsimage.Id + ";"); } } if (sb.ToString().Length > 0) { Query.ProcessSqlNonQuery(sb.ToString(), GlobalVar.DataBase_Name); } }
public bool CheckIsOverTime(string nick) { RetrieveCriteria rc = new RetrieveCriteria(typeof(tb_UserEntity)); Condition c = rc.GetNewCondition(); c.AddEqualTo(tb_UserEntity.__NICK,nick); tb_UserEntity ue=(tb_UserEntity)rc.AsEntity(); //体验版或者过期 if (ue.syslevel == ((int)Util.Enum.UserSysLevel.Experience).ToString() || ue.authEndTime < DateTime.Now) { return false; } else { return true; } }