/// <summary> /// 檢查會員是否已付過費用 如果已繳過則將status改為正常 /// </summary> private void MemberCheckStatus() { int intTWYear = new BTWYear().GetTop1().TWYear; //找出所有待繳費的使用者 //個人會員 BMemberP bllP = new BMemberP(); List <MMemberP> listP = bllP.GetListByWaitPay(); foreach (MMemberP mod in listP) { if (mod.Status == "待繳費") { if (new BOrder().CheckMemberFeePay(mod.MemberPID, "P") > 0 && new BOrder().CheckYearFeePay(mod.MemberPID, "P", mod.MemberClass, intTWYear) > 0) { mod.Status = "正常"; new BMemberP().Edit(mod); } } } //團體會員 BMemberG bllG = new BMemberG(); List <MMemberG> listG = bllG.GetListByWaitPay(); foreach (MMemberG mod in listG) { if (mod.Status == "待繳費") { if (new BOrder().CheckMemberFeePay(mod.MemberGID, "G") > 0 && new BOrder().CheckYearFeePay(mod.MemberGID, "G", mod.MemberClass, intTWYear) > 0) { mod.Status = "正常"; new BMemberG().Edit(mod); } } } }
/// <summary> /// 團體會員匯入 /// </summary> protected void SetMemberGTrans(DataSet dsMemberG) { //先刪除foodorg的memberG的所有資料 //取得所有資料 List <MMemberG> liFoodMemberG = new BMemberG().GetListByKeyword("", "全部", "全部"); lbState.Invoke((Action <string>)SetStatus, "刪除FoodOrg團體會員資料"); lbl_MemberGAll.Invoke((Action <string>)SetMemberGAll, liFoodMemberG.Count.ToString()); int intDel = 0; foreach (MMemberG mod in liFoodMemberG) { new BMemberG().Del(mod.MemberGID); intDel++; lbMemberGCount.Invoke((Action <int>)SetMemberG, intDel); } new BMemberG().DelAllBusiness(); if (dsMemberG.Tables[0].Rows.Count > 0) { lbState.Invoke((Action <string>)SetStatus, "從access取團體會員資料移到FoodOrg"); lbl_MemberGAll.Invoke((Action <string>)SetMemberGAll, dsMemberG.Tables[0].Rows.Count.ToString()); int i = 0; foreach (DataRow dr in dsMemberG.Tables[0].Rows) { MMemberG mod = new MMemberG(); string strMemberGid = dr["MARK"].ToString(); if (strMemberGid.Length == 4) { strMemberGid = "0" + strMemberGid; } mod.MemberGID = strMemberGid; if (dr["MemberPassword"].ToString().Length == 0) { //mod.MemberGassword = "000000"; mod.MemberGassword = TestLibrary.Common.Security.Encrypt("000000"); } else { mod.MemberGassword = dr["MemberPassword"].ToString(); } mod.NameC = dr["C_NAME"].ToString(); mod.CompanyID = dr["PID"].ToString(); //string strMemberClass = dr["MCLASS"].ToString(); mod.MemberClass = dr["MCLASS"].ToString(); mod.TEL = dr["TEL"].ToString(); mod.FAX = dr["FAX"].ToString(); mod.RegisterDate = DateTime.Parse(dr["INDATE"].ToString()); mod.ZipCode = dr["ZONE"].ToString(); mod.City = dr["ADDR_CITY"].ToString().Replace("台", "臺"); //mod.Area = dr["Area"].ToString(); mod.Area = ""; mod.Address = dr["ADDR_NUM"].ToString(); mod.ContactName = dr["CONN_MAN"].ToString(); mod.ContactTitle = dr["CONN_TITLE"].ToString(); mod.ContactTEL = dr["CONN_TEL"].ToString(); //mod.ContactMobile = dr["ContactMobile"].ToString(); mod.ContactMobile = ""; mod.ContactEmail = dr["EMAIL"].ToString(); mod.AgentName = dr["LEADER"].ToString(); mod.AgentTitle = dr["TITLE"].ToString(); //mod.AgentTEL = dr["AgentTEL"].ToString(); //mod.AgentMobile = dr["AgentMobile"].ToString(); //mod.AgentEmail = dr["AgentEmail"].ToString(); mod.AgentTEL = ""; mod.AgentMobile = ""; mod.AgentEmail = ""; mod.Memo = dr["Memo"].ToString(); //mod.Status = dr["Status"].ToString(); mod.Status = "正常"; mod.EDM = Convert.ToBoolean(dr["RECEIVE_MAIL"].ToString()); mod.CreateUser = "******"; mod.UpdateUser = "******"; new BMemberG().Add(mod); i++; lbMemberGCount.Invoke((Action <int>)SetMemberG, i); } } }