public static List <UserReply> GetUserReplys(string guid, string userid, int type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, int sourcetype = -1, bool ht = false, string keyWords = "") { string tablename = "UserReply a left join M_Users b on a.Guid =b.UserID left join M_Users c on a.CreateUserID =c.UserID "; string sqlwhere = " a.status<>9 "; if (!string.IsNullOrEmpty(keyWords)) { sqlwhere += " and ( b.username like'%" + keyWords + "%' or c.username like'%" + keyWords + "%')"; } if (!string.IsNullOrEmpty(guid)) { sqlwhere += " and a.guid='" + guid + "' "; } if (type > -1) { sqlwhere += " and a.Type=" + type; } if (!string.IsNullOrEmpty(userid)) { sqlwhere += " and a.CreateUserID='" + userid + "' "; } if (ht) { sqlwhere += " and a.guid in(select userid from M_users where status<>9 and SourceType=1) "; } if (sourcetype > -1) { //1后台 0前台 sqlwhere += " and c.SourceType=" + sourcetype + " "; } DataTable dt = CommonBusiness.GetPagerData(tablename, "a.*,b.LoginName as UserName,b.Avatar as UserAvatar,c.LoginName as FromName,c.Avatar as FromAvatar ", sqlwhere, "a.AutoID ", pageSize, pageIndex, out totalCount, out pageCount); List <UserReply> list = new List <UserReply>(); foreach (DataRow dr in dt.Rows) { UserReply model = new UserReply(); model.FillData(dr); list.Add(model); } return(list); }
public JsonResult GetStateAndCountries() { try { var states = CommonBusiness.GetStates(); var countries = CommonBusiness.GetCountries(); var response = new ApiRespnoseWrapper { status = ApiRespnoseStatus.Success, results = new ArrayList() { states, countries } }; return(new JsonResult { Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception ex) { return(CommonBusiness.GetErrorResponse(ex.Message)); } }
public JsonResult GetSingleBlog(int Id) { try { var results = BlogBusiness.GetSingleBlog(Id); var response = new ApiRespnoseWrapper { Status = ApiRespnoseStatus.Success, Results = new ArrayList() { results } }; return(new JsonResult { Data = response }); } catch (Exception ex) { CommonFunctions.LogDetails(ex, null); return(CommonBusiness.GetErrorResponse()); } }
public static List <LogEntity> GetOperatLogs(int type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string loginname = "") { string tablename = "UsersOperatLog a left join M_Users b on a.UserID =b.UserID "; string sqlwhere = " 1=1 "; if (!string.IsNullOrEmpty(loginname)) { sqlwhere += " and b.loginname ='" + loginname + "' "; } DataTable dt = CommonBusiness.GetPagerData(tablename, "a.* ,b.LoginName,b.UserName ", sqlwhere, "a.AutoID ", pageSize, pageIndex, out totalCount, out pageCount); List <LogEntity> list = new List <LogEntity>(); foreach (DataRow dr in dt.Rows) { LogEntity model = new LogEntity(); model.FillData(dr); list.Add(model); } return(list); }
public static List <ModulesProduct> GetModulesProducts(string keyWords, int pageSize, int pageIndex, int periodQuantity, ref int totalCount, ref int pageCount) { string sqlWhere = "p.Status<>9 "; if (periodQuantity > 0) { sqlWhere += " and periodQuantity=" + periodQuantity.ToString(); } DataTable dt = CommonBusiness.GetPagerData("ModulesProduct as p", " p.*", sqlWhere, "p.AutoID", " p.UserQuantity asc,p.PeriodQuantity asc", pageSize, pageIndex, out totalCount, out pageCount); List <ModulesProduct> list = new List <ModulesProduct>(); ModulesProduct model; foreach (DataRow item in dt.Rows) { model = new ModulesProduct(); model.FillData(item); list.Add(model); } return(list); }
public JsonResult GetTodyRopert(string cpcode = "cqssc", string issuenum = "") { var msg = "网络延迟,请稍后再试"; int totalCount = 0; var bibett = LotteryOrderBusiness.GetIssueNumFee(cpcode, issuenum.Trim(), ""); var fee = M_UsersBusiness.GetUserAccount(CurrentUser.UserID); var totalpayment = CommonBusiness.Select("AccountOperateRecord", "isnull(SUM(isnull(AccountChange,0)),0)", "PlayType in(4,5) and CreateTime>'" + DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00'"); var userwin = CommonBusiness.Select("AccountOperateRecord", "isnull(SUM(isnull(AccountChange,0)),0)", "PlayType =8 and CreateTime>'" + DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00'"); JsonDictionary.Add("totalpayment", totalpayment); JsonDictionary.Add("totalwin", userwin); JsonDictionary.Add("yl", Convert.ToDecimal(userwin) - Convert.ToDecimal(totalpayment)); JsonDictionary.Add("bettfee", bibett); JsonDictionary.Add("fee", fee); JsonDictionary.Add("Errmsg", msg); return(new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public JsonResult GetApplications(int id) { try { var jobs = CorporateBusiness.GetAppliedPosts(id); //var internships = CorporateBusiness.GetInternships(new PostFilterModel() { postType = 2, userId = id }); var response = new ApiRespnoseWrapper { status = ApiRespnoseStatus.Success, results = new ArrayList() { jobs } }; return(new JsonResult { Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception ex) { return(CommonBusiness.GetErrorResponse(ex.Message)); } }
public JsonResult GetAppliedProfiles(int postId) { try { var studentProfiles = CorporateBusiness.GetAppliedStudents(postId); var employeeProfiles = CorporateBusiness.GetAppliedEmployees(postId); var response = new ApiRespnoseWrapper { status = ApiRespnoseStatus.Success, results = new ArrayList() { studentProfiles, employeeProfiles } }; return(new JsonResult { Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception ex) { return(CommonBusiness.GetErrorResponse(ex.Message)); } }
public JsonResult DoLogin(LoginViewModel model) { try { var result = AccountBusiness.ValidateUser(model); var response = new ApiRespnoseWrapper { Status = ApiRespnoseStatus.Success, Results = new ArrayList() { result } }; return(new JsonResult { Data = response }); } catch (Exception ex) { CommonFunctions.LogDetails(ex, null); return(CommonBusiness.GetErrorResponse()); } }
public JsonResult GetAllBlogs() { try { var results = BlogBusiness.GetAllBlogs(); var response = new ApiRespnoseWrapper { Status = ApiRespnoseStatus.Success, Results = new ArrayList() { results } }; return(new JsonResult { Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception ex) { CommonFunctions.LogDetails(ex, null); return(CommonBusiness.GetErrorResponse()); } }
protected void btnApprove_OnClick(object sender, EventArgs e) { var btn = (Button)sender; var data = (GridDataItem)btn.NamingContainer; var studentCode = data["StudentCode"].Text; var student = _requestHandler.GetFinancialPermission().FirstOrDefault(x => x.StudentCode == studentCode); student.Permission = true; var id = _requestHandler.AddOrUpdateFinancialPermission(student); var userId = Convert.ToInt32(Session[sessionNames.userID_Karbar]); var comman = new CommonBusiness(); comman.InsertIntoUserLog(userId, DateTime.Now.ToString("HH:mm") , 11, 185, string.Format("{0}", "تایید مالی"), Convert.ToInt32(id)); var approveMessage = "درخواست شماره " + id.ToString() + " با موفقیت تایید گردید."; RadWindowManager1.RadAlert(approveMessage, 400, 100, "پیام سیستم", "closeRadWindow2"); }
private async static Task <string> Upload(PdfTransferOption option) { using (var client = new HttpClient()) using (var formData = new MultipartFormDataContent()) { formData.Add(new StringContent(option.Name, Encoding.UTF8), "name"); formData.Add(new StringContent(option.ShortName, Encoding.UTF8), "shortname"); //formData.Add(new StringContent(_codeTerm + option.ShortName, Encoding.UTF8), "shortname"); //formData.Add(new StringContent("123456789", Encoding.UTF8), "shortname"); formData.Add(new StringContent(option.Start, Encoding.UTF8), "start"); formData.Add(new StringContent(option.End, Encoding.UTF8), "end"); if (!(option.FileBytes is null)) { formData.Add(new ByteArrayContent(option.FileBytes), "repo_upload_file", option.FileName); } if (!(option.FileStream is null)) { formData.Add(new StreamContent(option.FileStream), "repo_upload_file", option.FileName); } var response = await client.PostAsync(option.Uri, formData); var status200 = response.IsSuccessStatusCode; if (!status200) { return(null); } var res = await response.Content.ReadAsStringAsync(); string jsonResult = JsonConvert.DeserializeObject <TransferdObjectResult>(res).Result; if (!string.IsNullOrEmpty(jsonResult) && CommonBusiness.IsNumeric(jsonResult) && decimal.Parse(jsonResult) > 0) { list.Add(new TransferdObject() { Did = option.ShortName, Status = response.IsSuccessStatusCode }); } return(res); } }
public JsonResult AddOrUpdateNotice(NoticeModel model) { try { var result = NoticeBusiness.AddOrUpdateNotice(model); var data = new ApiRespnoseWrapper() { status = ApiRespnoseStatus.Success, results = new ArrayList() { result } }; return(new JsonResult() { Data = data }); } catch (Exception ex) { return(CommonBusiness.GetErrorResponse(ex.Message)); } }
public JsonResult GetInternships(PostFilterModel model) { try { int count = 0; var result = CorporateBusiness.GetInternships(model, ref count); var pages = CommonBusiness.GetPages(count); var response = new ApiRespnoseWrapper { status = ApiRespnoseStatus.Success, results = new ArrayList() { result, pages } }; return(new JsonResult { Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception ex) { return(CommonBusiness.GetErrorResponse(ex.Message)); } }
protected void grdResult_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "History") { int reqID = Convert.ToInt32(e.CommandArgument); GridDataItem itemAmount = (GridDataItem)e.Item; string stcode = itemAmount["stcode"].Text; string stName = itemAmount["name"].Text; string reqDate = itemAmount["CreateDate"].Text; CommonBusiness cmb = new CommonBusiness(); lst_history.DataSource = cmb.GetUserLogByModifyId(int.Parse(e.CommandArgument.ToString()), 12); lst_history.DataBind(); info1.InnerText = "نام دانشجو:" + stName; info2.InnerText = "شماره درخواست:" + reqID; info3.InnerText = "تاریخ درخواست:" + reqDate; ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); } }
public async Task CreateAsync(AuthenticationTokenCreateContext context) { var clientid = context.Ticket.Properties.Dictionary["as:client_id"]; if (string.IsNullOrEmpty(clientid)) { return; } var refreshTokenId = Guid.NewGuid().ToString("n"); CommonBusiness commonBu = new CommonBusiness(); var token = new OAuthRefreshToken() { TokenId = refreshTokenId.GetHash(), Authentication = context.SerializeTicket() }; commonBu.Save(token); commonBu.getDbContext().SaveChanges(); context.SetToken(refreshTokenId); }
/// <summary> /// 获取日志 /// </summary> /// <returns></returns> public static List <LogEntity> GetLogs(string type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string btime = "", string etime = "", string userid = "", string loginname = "") { string tablename = "UsersLog a left join M_Users b on a.UserID =b.UserID "; string sqlwhere = " 1=1 "; if (!string.IsNullOrEmpty(btime)) { sqlwhere += " and a.CreateTime>='" + (string.IsNullOrEmpty(btime) ? DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd HH:mm:ss") : btime) + "'"; } if (!string.IsNullOrEmpty(userid)) { sqlwhere += " and a.userid ='" + userid + "' "; } if (!string.IsNullOrEmpty(loginname)) { sqlwhere += " and b.loginname ='" + loginname + "' "; } if (!string.IsNullOrEmpty(type)) { sqlwhere += " and a.Type in(" + type + ")"; } if (!string.IsNullOrEmpty(etime)) { sqlwhere += " and a.CreateTime<'" + etime + "'"; } DataTable dt = CommonBusiness.GetPagerData(tablename, "a.* ,b.LoginName,b.UserName ", sqlwhere, "a.AutoID ", pageSize, pageIndex, out totalCount, out pageCount); List <LogEntity> list = new List <LogEntity>(); foreach (DataRow dr in dt.Rows) { LogEntity model = new LogEntity(); model.FillData(dr); list.Add(model); } return(list); }
/// <summary> /// saves new slack team after successfully granted /// </summary> private void SaveSlackTeam(OAuthResponse oAuthResp) { var team = new Team { Name = oAuthResp.team_name, SlackId = oAuthResp.team_id, IsActive = true, AccountType = AccountType.Trial, BotId = oAuthResp.bot.bot_user_id, BotAccessToken = oAuthResp.bot.bot_access_token, MemberCount = 1, Language = Language.Turkish, ExpiresIn = CommonBusiness.GetSlackTeamExpirationDate(AccountType.Trial), CreatedAt = DateTime.UtcNow, TeamScopes = GetTeamScopes(), MainCurrency = MainCurrency.Try, Channel = "#general", // default channel Provider = Provider.CoinMarketCap }; _teamBusiness.Add(team); }
public JsonResult GetCommonDataForNewPost() { try { var cities = CommonBusiness.GetCities(); var skills = CommonBusiness.GetSkills(); var tags = CommonBusiness.GetTags(); var response = new ApiRespnoseWrapper { status = ApiRespnoseStatus.Success, results = new ArrayList() { cities, skills, tags } }; return(new JsonResult { Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception ex) { return(CommonBusiness.GetErrorResponse(ex.Message)); } }
public JsonResult LoginCheck(string txtUname, string txtPWD) { var result = false; var msg = "操作失败"; var Dt = CommonBusiness.GetAppSet().Where(x => x.KName == "Login").FirstOrDefault(); if (Dt != null && Dt.AutoID > 0) { if (Dt.KValue == txtUname && txtPWD == Dt.KValue) { Session["IsLogin"] = txtPWD; result = true; } } JsonDictionary.Add("result", result); JsonDictionary.Add("Errmsg", msg); return(new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public static List <ExpressCompany> GetExpressCompanys(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount) { string sqlWhere = "Status<>9"; if (!string.IsNullOrEmpty(keyWords)) { sqlWhere += " and Name like '%" + keyWords + "%'"; } DataTable dt = CommonBusiness.GetPagerData("ExpressCompany", "*", sqlWhere, "AutoID", pageSize, pageIndex, out totalCount, out pageCount); List <ExpressCompany> list = new List <ExpressCompany>(); ExpressCompany model; foreach (DataRow item in dt.Rows) { model = new ExpressCompany(); model.FillData(item); list.Add(model); } return(list); }
public JsonResult DeleteNotice(int id) { try { var result = NoticeBusiness.DeleteNotice(id); var data = new ApiRespnoseWrapper() { status = ApiRespnoseStatus.Success, results = new ArrayList() { result } }; return(new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception ex) { return(CommonBusiness.GetErrorResponse(ex.Message)); } }
private bool ResourceLog(bool resualt, int userId, int id) { CommonBusiness common = new CommonBusiness(); if (!resualt) { var myResourc = ResourceDB.GetResourceList() .FirstOrDefault(c => c.ID == id); if (myResourc == null) { return(false); } var resourcId = myResourc.ID; common.InsertIntoUserLog(userId, "", 11, 142, "ویرایش کلاس موجود", resourcId); return(false); } else { return(true); } }
protected void btnHistory_OnClick(object sender, EventArgs e) { RequestHandler _reqHandler = new RequestHandler(); CommonBusiness cmb = new CommonBusiness(); Button btn = (Button)sender; string id = btn.CommandArgument; var dtLog = cmb.GetUserAndStudentLogModifyId(int.Parse(id), 11);//.AsEnumerable(); var myLog = RequestHandler.ConvertDataTableToList <logDetail>(dtLog) .OrderBy(o => o.LogDate.ToGregorian()) .ThenBy(x => x.LogTime.TimeToTicks()); //var Rows = (from row in dtLog // orderby row["LogDate"].ToString().ToGregorian() // select row); lst_history.DataSource = myLog;// Rows; lst_history.DataBind(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); }
public JsonResult Login(LoginRequestModel model) { try { var result = AccountBusiness.Login(model); var data = new ApiRespnoseWrapper() { status = ApiRespnoseStatus.Success, results = new ArrayList() { result } }; return(new JsonResult() { Data = data }); } catch (Exception ex) { return(CommonBusiness.GetErrorResponse(ex.Message)); } }
protected void btn_Save_Click(object sender, EventArgs e) { if (fileuploader.HasFile) { string did = Request.QueryString["did"].ToString(); DataTable dt = new DataTable(); dt = eBusiness.GetDidByCodeOstad(int.Parse(Session[sessionNames.userID_StudentOstad].ToString())); string pre = CommonBusiness.getFileExtension(fileuploader.FileName); string path = Server.MapPath("~/QueizPapers/" + dt.Rows[0]["tterm"].ToString() + "/" + Session[sessionNames.userID_StudentOstad].ToString() + "/"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string Address = "../QueizPapers/" + dt.Rows[0]["tterm"].ToString() + "/" + Session[sessionNames.userID_StudentOstad].ToString() + "/" + did.ToString() + "Attached." + pre; //eBusiness.UploadExamFile(Address, "t123@456", did); eBusiness.UploadAttachment(did, Address); SaveFile(fileuploader.PostedFile, path, did + "Attached." + pre); ConvertTopdf(did + "Attached", pre, path, did); using (ZipFile zip = ZipFile.Read(path + "\\" + did + ".zip")) { ZipEntry z = zip[did + "." + pre]; if (z == null) { FileStream stream = new FileStream(path + "\\" + did + "Attached" + "." + pre, FileMode.Open, FileAccess.ReadWrite); zip.AddEntry(did + "Attached" + "." + pre, stream); zip.Save(); System.IO.File.Delete(path + "\\" + did + "Attached" + "." + pre); } else System.IO.File.Delete(path + "\\" + did + "Attached" + "." + pre); } cmnb.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_StudentOstad].ToString()), DateTime.Now.ToShortTimeString(), int.Parse(Session[sessionNames.appID_StudentOstad].ToString()), 63, "آپلود پیوست"); rwm.RadAlert("فایل با موفقیت آپلود شد", null, 50, "پیام", null); ScriptManager.RegisterStartupScript(this, GetType(), "btn_Save", "CloseModal();", true); } }
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e) { CommonBusiness cmnb = new CommonBusiness(); if (e.CommandName == "flv") { GridDataItem itemAmount = (GridDataItem)e.Item; TableCell fd = (TableCell)itemAmount["FileDate"]; TableCell classcode = (TableCell)itemAmount["Class_Code"]; TableCell term = (TableCell)itemAmount["Term"]; string d = fd.Text.Replace('/', '-'); cmnb.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_Karbar].ToString()), DateTime.Now.ToShortTimeString(), int.Parse(Session[sessionNames.appID_Karbar].ToString()), 24, ""); SendFileToUser(Server.MapPath("../content/" + term.Text + "/" + classcode.Text + "/" + d + "/" + "flv.zip")); } if (e.CommandName == "mp3") { GridDataItem itemAmount = (GridDataItem)e.Item; TableCell fd = (TableCell)itemAmount["FileDate"]; TableCell classcode = (TableCell)itemAmount["Class_Code"]; TableCell term = (TableCell)itemAmount["Term"]; string d = fd.Text.Replace('/', '-'); cmnb.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_Karbar].ToString()), DateTime.Now.ToShortTimeString(), int.Parse(Session[sessionNames.appID_Karbar].ToString()), 23, ""); SendFileToUser(Server.MapPath("../content/" + term.Text + "/" + classcode.Text + "/" + d + "/" + "mp3.zip")); } if (e.CommandName == "avi") { GridDataItem itemAmount = (GridDataItem)e.Item; TableCell fd = (TableCell)itemAmount["FileDate"]; TableCell classcode = (TableCell)itemAmount["Class_Code"]; TableCell term = (TableCell)itemAmount["Term"]; string d = fd.Text.Replace('/', '-'); cmnb.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_Karbar].ToString()), DateTime.Now.ToShortTimeString(), int.Parse(Session[sessionNames.appID_Karbar].ToString()), 25, ""); SendFileToUser(Server.MapPath("../content/" + term.Text + "/" + classcode.Text + "/" + d + "/" + "avi.zip")); } }
protected void btnDenyRequest_Click(object sender, EventArgs e) { if (IsValid) { RequestFR req = new RequestFR(); userID = Convert.ToInt32(Session[sessionNames.userID_Karbar]); req.ID = Convert.ToInt32(hdnfDenyReqId.Value); req.ReplierID = userID;//education user ID req.Answernote = txtDenyMessage.Text; req.Answer_time = DateTime.Now.ToPeString(); req.Status = 3;//3 means request has been denied . RequestHandler requestBusiness = new RequestHandler(); int id = requestBusiness.DenyRequest(req); var comman = new CommonBusiness(); comman.InsertIntoUserLog(userID, DateTime.Now.ToString("HH:mm"), 11, 124, string.Format("{0} :{1}", "حذف درخواست کلاس توسط آموزش", txtDenyMessage.Text), req.ID); txtDenyMessage.Text = string.Empty; string denyMessage = "درخواست شماره " + id.ToString() + " رد شد."; RadWindowManager1.RadAlert(denyMessage, 300, 100, "پیام سیستم", "closeRadWindow2"); } }
protected void grdRequestLists_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "History") { GridDataItem itemAmount = (GridDataItem)e.Item; int ID; ID = Convert.ToInt32(e.CommandArgument); string userID = itemAmount["issuerID"].Text; string username = itemAmount["issuerName"].Text; string reqDate = itemAmount["issue_time"].Text; string reqID = itemAmount["ID"].Text; CommonBusiness cmb = new CommonBusiness(); lst_history.DataSource = cmb.GetUserLogByModifyId(int.Parse(e.CommandArgument.ToString()), 11); lst_history.DataBind(); info1.InnerText = "نام درخواست کننده:" + username; info2.InnerText = "شماره درخواست:" + reqID; info3.InnerText = "تاریخ درخواست:" + reqDate; ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); } }
protected void Page_Load(object sender, EventArgs e) { try { string mId = Request.QueryString["id"].ToString(); string[] id = mId.ToString().Split(new char[] { '@' }); string menuId = ""; for (int i = 0; i < id[1].Length; i++) { string s = id[1].Substring(i + 1, 1); if (s != "-") { menuId += s; } else { break; } } AccessControl1.MenuId = menuId; Session[sessionNames.menuID] = menuId; AccessControl1.UserId = Session[sessionNames.userID_Karbar].ToString(); if (!IsPostBack) { CommonBusiness cmb = new CommonBusiness(); cmb_Term.DataSource = cmb.getActiveTerm_AdobeConnection(); cmb_Term.DataTextField = "Term"; cmb_Term.DataValueField = "Term"; cmb_Term.DataBind(); } } catch { } }