public void fillGrdUser() { ViewModel.Search SearchUser = new ViewModel.Search(); SearchUser.Order = "Order by LName "; DataSet dsUser = BisPersonel.GetPersonelData(SearchUser); grdUser.DataSource = dsUser; grdUser.DataBind(); Session["dsUser"] = dsUser; Session["dsUserIndex"] = dsUser; }
protected void fillDrpUser() { try { ViewModel.Search user = new ViewModel.Search(); user.Filter = "and Active='True' "; user.Order = " order by FName Asc"; DataSet ds = BisPersonel.GetPersonelData(user); drpUser.DataSource = ds; drpUser.DataTextField = "FullName"; drpUser.DataValueField = "IDUser"; drpUser.DataBind(); drpUser.Items.Insert(0, new ListItem("-انتخاب کنید -", Guid.Empty.ToString())); } catch { ScriptManager.RegisterStartupScript(this, GetType(), "OkMessage", "alert('اشکال در برقراری ارتباط با دیتابیس!');", true); } }
protected void Page_Init(object sender, EventArgs e) { if (Request.Cookies["IDLogUser"] == null) { Response.Redirect("Login.aspx"); } dsUser = (DataSet)Session["User"]; if (dsUser.Null_Ds()) { ViewModel.Search getLogUser = new ViewModel.Search(); getLogUser.Filter = " and tblLogUser.IDLogUser = '******'"; DataSet dsLoguser = BislogUser.GetLogUserData(getLogUser); ViewModel.Search SearchUser = new ViewModel.Search(); SearchUser.Filter = " and tblUser.IDUser = '******'"; dsUser = BisPersonel.GetPersonelData(SearchUser); Session["User"] = dsUser; } lblUserName.Text = dsUser.ReturnDataSetField("FName") + " " + dsUser.ReturnDataSetField("LName"); if (dsUser.ReturnDataSetField("PicUrl") != "") { imgUser.ImageUrl = "../" + dsUser.ReturnDataSetField("PicUrl"); } else { imgUser.ImageUrl = "images/user_male.png"; } if (!dsUser.Null_Ds()) { dtMenu = FillMenu(dsUser.ReturnDataSetField("IDUser").StringToGuid()); LoadComment(); top_menu.Visible = dsUser.ReturnDataSetField("PowerUser").StringToBool(); generateMenu(); } else { Response.Redirect("login.aspx"); } }
public IHttpActionResult PreparationForNewsLetter(ViewModel.tblSentEmail SentEmail) { try { Guid IDUser = AuUser.ReturnIDUser(SentEmail.IDLogUser); ViewModel.Search searchPersonel = new ViewModel.Search(); searchPersonel.Filter = " AND tblPersonel.IDUser = '******'"; DataSet dsPersonel = BisPersonel.GetPersonelData(searchPersonel); SentEmail.IDSender = dsPersonel.ReturnDataSetField("IDUser").StringToGuid(); SentEmail.SenderFirstName = dsPersonel.ReturnDataSetField("FName"); SentEmail.SenderLastName = dsPersonel.ReturnDataSetField("LName"); string NewsLetterStructure = System.IO.File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"\Templates\NewsLetterStructure.txt"); SentEmail.Body = NewsLetterStructure.Replace("@@Content", SentEmail.Body); bool ret = BisSentEmail.PreparationForNewsLetter(SentEmail); return(Ok(ret)); } catch { return(NotFound()); } }
public List <string> getPersonel(string prefix) { Bis.PersonelMethod bisPersonel = new Bis.PersonelMethod(); ViewModel.Search searchPersonel = new ViewModel.Search(); searchPersonel.Filter = " and tblPersonel.FName +' '+ tblPersonel.LName like N'%" + prefix.FixFarsi() + "%' and Active='true'"; //searchCompany.Order = "order by tblLegalUser.Name_Fa desc"; DataSet dsPersonel = bisPersonel.GetPersonelData(searchPersonel); List <string> PersonelNames = new List <string>(); if (!dsPersonel.Null_Ds()) { for (int i = 0; i < dsPersonel.Tables[0].Rows.Count; i++) { PersonelNames.Add(string.Format("{0}~{1}", dsPersonel.Tables[0].Rows[i]["FullName"].ToString(), dsPersonel.Tables[0].Rows[i]["IDUser"].ToString())); } return(PersonelNames); } else { PersonelNames.Add(string.Format("{0}~{1}", "اطلاعاتی یافت نشد", Guid.Empty)); return(PersonelNames); } }