public ActionResult Create([Bind(Include = "Id,Name,ClientId,Gender,ImagePath")] Patient patient, HttpPostedFileBase file) { if (ModelState.IsValid && patient.Name != null && patient.Gender != 0) { var patientBll = new PatientBLL(); if (file != null && file.ContentLength > 0) { string filename = Path.GetFileName(file.FileName); string imgpath = Path.Combine(Server.MapPath("~/Content/PatientImages/"), filename); file.SaveAs(imgpath); patient.ImgPath = "~/Content/PatientImages/" + file.FileName; } else { patient.ImgPath = "~/Content/PatientImages/default.jpg"; } patientBll.Insert(patient); return(RedirectToAction("Index")); } var clientBll = new ClientBLL(); ViewBag.ClientId = new SelectList(clientBll.List(), "Id", "FullName", patient.ClientId); return(View(patient)); }
// GET: Patients/Create public ActionResult Create() { var clientBll = new ClientBLL(); ViewBag.ClientId = new SelectList(clientBll.List(), "Id", "FullName"); return(View()); }
public void ProcessRequest(HttpContext context) { try { LoginUser loginUser = new LoginUser(context, "ClientRecharge"); if (!loginUser.Pass)//权限验证 { return; } //加载DataGrid if (context.Request["action"] == "gridLoad") { ClientRechargeBLL bll = new ClientRechargeBLL(context, loginUser); int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string clientId = context.Request["clientId"]; string agentId = context.Request["agentId"]; string siteId = context.Request["siteId"]; string cardId = context.Request["cardId"]; string clientName = context.Request["clientName"]; bll.LoadGrid(page, rows, clientId, agentId, siteId, cardId, clientName); return; } if (context.Request["action"] == "totalFee") { ClientRechargeBLL bll = new ClientRechargeBLL(context, loginUser); string clientId = context.Request["clientId"]; string agentId = context.Request["agentId"]; string siteId = context.Request["siteId"]; string cardId = context.Request["cardId"]; string clientName = context.Request["clientName"]; context.Response.Write(bll.GetTotalFee(clientId, agentId, siteId, cardId, clientName)); return; } //加载信息 if (context.Request["action"] == "load") { ClientRechargeBLL bll = new ClientRechargeBLL(context, loginUser); long flowId = long.Parse(context.Request["flowId"]);//编号 bll.Load(flowId); return; } if (context.Request["action"] == "agentListLoad") { ClientBLL bll = new ClientBLL(context, loginUser); bll.AgentCombobox(); } if (context.Request["action"] == "siteListLoad") { ClientBLL bll = new ClientBLL(context, loginUser); string agentId = context.Request["agentId"]; bll.SiteCombobox(agentId); } } catch (Exception e) { Message.error(context, e.Message); } }
private void btnStergereCont_Click(object sender, RoutedEventArgs e) { try { ClientBLL clientBLL = new ClientBLL(); ClientBLL.deleteClient(clientOriginal); ContBLL.deleteClient(contOriginal); if (userType == "admin") { listaConturiWindow.deseneazaForme(); } MessageBox.Show("Contul a fost sters cu succes"); if (userType == "client") { Application.Current.Shutdown(); } else if (userType == "admin") { this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public bool Delete(ClientBLL u) { bool isSuccess = false; SqlConnection conn = new SqlConnection(myconnstrng); try { string sql = "DELETE FROM CLIENT WHERE client_id=@client_id"; SqlCommand cmd = new SqlCommand(sql, conn); cmd.Parameters.AddWithValue("@client_id", u.client_id); conn.Open(); int rows = cmd.ExecuteNonQuery(); if (rows > 0)//Querry a functionat { isSuccess = true; } else { isSuccess = false; } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { conn.Close(); } return(isSuccess); }
public FormClient(FormCompt formCpt) { InitializeComponent(); clientBLL = new ClientBLL(); comptBLL = new CompteBLL(); this.formCompt = formCpt; }
public Planos() { InitializeComponent(); ClientBLL bll = new ClientBLL(); //database to insert view plan, this report to app plans content in table planos of database sbclubd DataTable dataTable = new DataTable(); dataTable = bll.LoadPlanos(); int rows = dataTable.Rows.Count; rows -= 1; //load datatable and launch in screen to user to see if (rows >= 0) { txtPlano_1.Text = dataTable.Rows[0][0].ToString(); txtPlano_2.Text = dataTable.Rows[0][2].ToString(); txtPlano_3.Text = dataTable.Rows[0][4].ToString(); txtPlano_4.Text = dataTable.Rows[0][6].ToString(); txtTipo_1.Text = dataTable.Rows[0][1].ToString(); txtTipo_2.Text = dataTable.Rows[0][3].ToString(); txtTipo_3.Text = dataTable.Rows[0][5].ToString(); txtTipo_4.Text = dataTable.Rows[0][7].ToString(); } else { MessageBox.Show("Não existe planos cadastrados para esse usuário\nContacte o Administrador SBClub", "SBClub", MessageBoxButton.OK, MessageBoxImage.Information); } }
private void LoadClient(Guid ClientId) { ClientBLL objClient = new ClientBLL(); try { objClient = ClientBLL.GetClinet(ClientId); if (objClient != null) { string strName = ""; try { strName = objClient.ClientName.ToString(); } catch { this.lblmsg.Text = "unable to get Client related Data"; this.lblmsg.CssClass = "message"; this.btnAdd.Enabled = false; } this.lblClinet.Text = objClient.ClientId + " - " + strName; hfClientId.Value = ClientId.ToString(); } } catch (Exception ex) { throw new Exception("Unable to load client data", ex); } }
private void btnActualizare_Click(object sender, RoutedEventArgs e) { Client clientModificat = getClient(); clientModificat.IdClient = clientOriginal.IdClient; Cont contModificat = getCont(); try { ClientBLL clientBLL = new ClientBLL(); //ClientBLL.updateClient(clientModificat, clientOriginal); if (clientBLL.validareClient(clientModificat) == 1) { ContBLL.updateClient(contModificat, contOriginal); ClientBLL.updateClient(clientModificat, clientOriginal); if (userType == "client") { clientWindow.setContClient(contModificat, clientModificat); } else if (userType == "admin") { listaConturiWindow.setContClient(contModificat, clientModificat); } MessageBox.Show("Contul a fost modificat cu succes"); } this.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void ShowClients(string filter) { if (fpnClients.Controls.Count > 0) { fpnClients.Controls.Clear(); } var all = new ClientBLL().RetrieveALL(); List <Client> c = new List <Client>(); foreach (var item in all) { if (System.Text.RegularExpressions.Regex.IsMatch(item.UserName, filter)) { c.Add(item); } } all = c; ClientsPanel[] clients = new ClientsPanel[c.Count]; for (int i = 0; i < clients.Length; i++) { clients[i] = new ClientsPanel(table.Size.Width, table.Size.Height) { ID = all[i].ID, FirstName = all[i].FirstName, LastName = all[i].LastName, UserName = all[i].UserName, Password = all[i].Password, Gender = all[i].Gender.Name, Birthday = all[i].Birthday.ToString("dd-MM-yyyy") }; fpnClients.Controls.Add(clients[i]); } }
private void ShowClients(bool genre) { if (fpnClients.Controls.Count > 0) { fpnClients.Controls.Clear(); } List <Client> c; if (genre == true) { c = new ClientBLL().RetrieveByGenre(1); } else { c = new ClientBLL().RetrieveByGenre(2); } ClientsPanel[] clients = new ClientsPanel[c.Count]; for (int i = 0; i < clients.Length; i++) { clients[i] = new ClientsPanel(table.Size.Width, table.Size.Height) { ID = c[i].ID, FirstName = c[i].FirstName, LastName = c[i].LastName, UserName = c[i].UserName, Password = c[i].Password, Gender = c[i].Gender.Name, Birthday = c[i].Birthday.ToString("dd-MM-yyyy") }; fpnClients.Controls.Add(clients[i]); } }
private void salvareBtn_Click(object sender, RoutedEventArgs e) { if (daRadioBtn.IsChecked == true) { eClientLoial = 'Y'; } else { eClientLoial = 'N'; } Client clientModificat = new Client(id, username, nume, prenume, cnp, adresa, nrTelefon, email, eClientLoial); try { ClientBLL clientBLL = new ClientBLL(); if (clientBLL.validareClient(clientModificat) == 1) { ClientBLL.updateClient(clientModificat, clientOriginal); listaConturiWindow.setClient(clientModificat); } this.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
protected void Login1_Authenticate1(object sender, AuthenticateEventArgs e) { if (Membership.ValidateUser(Login1.UserName, Login1.Password) == true) { Login1.Visible = true; // Session["user"] = HttpContext.Current.User.Identity.Name; // Session["user1"] = Login1.UserName; FormsAuthentication.RedirectFromLoginPage(Login1.UserName, true); //check user is a Client bool isClient = AppSettings.IsUserOfType(Login1.UserName, isTypeClient: true); //is so redirect to config panel if (isClient) { Guid clientASPID = (Guid)AppSettings.GetUserIDByUserName(Login1.UserName); int clientID = (int)ClientBLL.GetPersonIDByASPuserID(clientASPID); //get compId int?curCoID = CompanyBLL.GetCompanyIDByClientID(clientID); if (curCoID != null) { SessionVariables.CompanyID = curCoID; } Response.Redirect("~/UI/ConfigPanel/Welcome.aspx"); } //else //end-user? redirect to clients page??18/7/16 } else { Response.Write("Invalid Login"); } }
public DataTable Get() { ClientBLL oClient = new ClientBLL(); IEnumerable <Client> lClient = oClient.Get(); return(ToDataTable <Client>(lClient.ToList())); }
private void LoadGRNInformation(Guid GRN) { LoadGRNType(); GRNBLL obj = new GRNBLL(); obj = obj.GetbyGRN_Number(GRN); if (obj != null) { if (obj.GRN_Number != "") { this.hfGRNID.Value = obj.Id.ToString(); this.lblGRN.Text = obj.GRN_Number; this.lblTrackingNo.Text = obj.TrackingNo; this.lblProductionYear.Text = obj.ProductionYear.ToString(); this.lblCode.Text = obj.GradingCode; this.lblDateDeposited.Text = obj.DateDeposited.ToShortDateString(); this.lblBags.Text = obj.TotalNumberOfBags.ToString(); this.lblGrossWeight.Text = obj.GrossWeight.ToString(); this.lblNetWeight.Text = obj.NetWeight.ToString(); this.lblOriginalQuantity.Text = obj.OriginalQuantity.ToString(); this.lblCurrentQuantity.Text = obj.CurrentQuantity.ToString(); lblGRNCreatedDate.Text = obj.GRNCreatedDate.ToShortDateString(); cmpSampGen.ValueToCompare = obj.CreatedTimestamp.ToShortDateString(); this.lblCommodityGrade.Text = CommodityGradeBLL.GetCommodityGradeNameById(obj.CommodityGradeId); ClientBLL objClient = new ClientBLL(); //objClient = ClientBLL.GetClinet(obj.ClientId); //this.lblClinet.Text = objClient.ClientName; LoadSampling(obj.GradingId); LoadGrading(obj.GradingId); LoadDepositeRequest(obj.CommodityRecivingId); this.cboGRNType.SelectedValue = obj.GRNTypeId.ToString(); BagTypeBLL objBag = new BagTypeBLL(); objBag.GetBagTypeById(obj.BagTypeId); this.lblBagType.Text = objBag.BagTypeName; this.cboStatus.SelectedValue = obj.Status.ToString(); if (obj.ClientAccepted == true) { this.cboClientAccpted.SelectedValue = "1"; } else { this.cboClientAccpted.SelectedValue = "2"; } this.txtClientAcceptedTimeStamp.Text = obj.ClientAcceptedTimeStamp.ToString(); this.hfStatus.Value = obj.Status.ToString(); if (this.cboStatus.SelectedValue == "4" && this.cboStatus.SelectedValue == "5" && this.cboStatus.SelectedValue == "6") { this.cboStatus.Enabled = false; this.cboClientAccpted.Enabled = false; this.btnAdd.Enabled = false; this.txtClientAcceptedTimeStamp.Enabled = false; this.txtClientAcceptedTimeStamp.Visible = false; this.cboClientAccpted.Visible = false; this.btnAdd.Visible = false; this.lblmsg.Text = "The Client can not accpet or reject this GRN as the status of the GRN is not new or approved."; } } } }
public bool Post(string Identification, string Name, string LastName) { Client eClient = new Client { Identification = Identification, Name = Name, LastName = LastName }; ClientBLL oClient = new ClientBLL(); return((oClient.Post(eClient) != null) ? true : false); }
private void btnAdd_Click(object sender, EventArgs e) { //var MovieBLL = new MovieBLL(); if (ValidateChildren(ValidationConstraints.Enabled)) { new EventBLL().Create(new Event() { Movie = (Movie)cbMovies.SelectedItem, Title = txtTittle.Text, Sales = (double)numericSales.Value, Description = txtDescription.Text, ImagePath = txtImagePath.Text, StartDate = dtStartDate.Value, EndDate = dtEndDate.Value, EventType = (EventType)cbType.SelectedItem, BaseAuditObject = new BaseAudit() { InsertBy = UserSession.CurrentUser.ID, InsertDate = DateTime.Now } }); DialogResult result = MessageBox.Show("Event sucessfully added! \n Do you want to add another event?", "Event sucessfully added!", MessageBoxButtons.YesNo); var movie = (Movie)cbMovies.SelectedItem; try { //List<Task> tasks = new List<Task>(); var smtpClient = new SmtpClient("smtp.gmail.com") { Port = 587, Credentials = new NetworkCredential("*****@*****.**", "ardenisi00"), EnableSsl = true, }; var mailMessage = new MailMessage { From = new MailAddress("*****@*****.**"), Subject = "New event is happening right now! DONT MISS IT!", Body = $"<h1>Event: {txtTittle.Text}</h1><br><h2>Discount: {(double)numericSales.Value} %</h2><br><h2>Movie: {movie.Title}</h2><br><h2>Start: {dtStartDate.Value.ToString("dd-MM-yyyy")}</h2><br><h2> End: {dtEndDate.Value.ToString("dd-MM-yyyy")}</h2>", IsBodyHtml = true, }; var clients = new ClientBLL().RetrieveALL(); foreach (var client in clients) { mailMessage.To.Add(client.UserName); smtpClient.Send(mailMessage); } } catch (Exception ex) { string a = ex.Message; } if (result == DialogResult.Yes) { txtTittle.Text = txtDescription.Text = txtImagePath.Text = ""; dtStartDate.Value = DateTime.Now; dtEndDate.Value = DateTime.Now; cbType.SelectedIndex = -1; cbMovies.SelectedIndex = -1; } else if (result == DialogResult.No) { this.Close(); } } }
public Cli() { clientBLL = new ClientBLL(); historyBLL = new HistoryBLL(); optionBLL = new OptionBLL(); planBLL = new PlanBLL(); subOptionBLL = new SubOptionBLL(); subscriptionBLL = new SubscriptionBLL(); }
public object AddClient([FromBody] Client client) { if (ClientBLL.CheckIsDuplicate(Guid.Empty, client.ClientIdentity)) { return(new { Success = false, Duplicated = true }); } ClientBLL.CreateClient(client); return(new { Success = true }); }
private void RefreshItems() { var business = new ClientBLL(); this.items = business.Get(); this.grdItems.DataSource = this.items; this.grdItems.DataBind(); }
public FormSearchCheckIn() { InitializeComponent(); _checkInBLL = new CheckInBLL(); _roomBLL = new RoomBLL(); _clientBLL = new ClientBLL(); checkIn = new CheckIn(); _checkInsGrid = new List <CheckInGrid>(); }
public FormSearchReservation(string clientCpf = "") { InitializeComponent(); filterClient = clientCpf; _reservationBLL = new ReservationBLL(); _roomBLL = new RoomBLL(); _clientBLL = new ClientBLL(); _reservationsGrid = new List <ReservationGrid>(); reservation = new Reservation(); }
/// <summary> /// 下拉列表选择事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void com_client_id_SelectionChangeCommitted(object sender, EventArgs e) { cb = new ClientBLL(); cm = cb.FindId((int)com_client_id.SelectedValue)[0]; text_client_name.Text = cm.Client_name; text_client_position.Text = cm.Client_address; text_client_contacts.Text = cm.Client_contacts; text_client_phone.Text = cm.Client_phone; text_client_note.Text = cm.Client_note; }
public void ProcessRequest(HttpContext context) { try { LoginAgentUser loginAgentUser = new LoginAgentUser(context, "ClientAccDetail"); AgentRoleBLL agentRoleBLL = new AgentRoleBLL(context, loginAgentUser); StaffBLL staffBll = new StaffBLL(context, loginAgentUser); if (!loginAgentUser.Pass)//权限验证 { return; } //获取用户登录的角色类型 0为 代理商 1 为员工 string roleType = agentRoleBLL.GetRoleType(loginAgentUser.RoleIds); string agentId = ""; string siteId = context.Request["siteId"]; if (roleType == "0") { agentId = loginAgentUser.UserId; } if (roleType != "0") { siteId = staffBll.Get(loginAgentUser.UserId).siteId; } //加载DataGrid if (context.Request["action"] == "gridLoad") { ClientAccDetailBLL bll = new ClientAccDetailBLL(context, loginAgentUser); int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string clientId = context.Request["clientId"]; string cardId = context.Request["cardId"]; string clientName = context.Request["clientName"]; bll.LoadGrid(page, rows, clientId, agentId, siteId, cardId, clientName); return; } //加载信息 if (context.Request["action"] == "load") { ClientAccDetailBLL bll = new ClientAccDetailBLL(context, loginAgentUser); long flowId = long.Parse(context.Request["flowId"]);//编号 bll.Load(flowId); return; } if (context.Request["action"] == "siteListLoad") { ClientBLL bll = new ClientBLL(context, loginAgentUser); bll.SiteCombobox(loginAgentUser.UserId, roleType); } } catch (Exception e) { Message.error(context, e.Message); } }
private void CallBusinessAction(Action <ClientBLL, Client> action) { var model = this.CreateModelFromUI(); var business = new ClientBLL(); action(business, model); this.ClearControls(); this.RefreshItems(); }
public FormCheckOut() { InitializeComponent(); _checkOutBLL = new CheckOutBLL(); _clientBLL = new ClientBLL(); _roomBLL = new RoomBLL(); _saleBLL = new SaleBLL(); sale = new Sale(); _checkIn = new CheckIn(); _sales = new List <Sale>(); }
/// <summary> /// 客户管理按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_manager_Click(object sender, EventArgs e) { Title.Text = "客户信息"; cb = new ClientBLL(); com_client_id.DisplayMember = "Client_name"; //绑定下拉列表 com_client_id.ValueMember = "Id"; com_client_id.DataSource = cb.FindAll(); com_client_id.SelectedItem = null; panel_manage.Visible = true; //显示客户管理 panel_new.Visible = false; ReSet(); }
private void LoadClients() { var business = new ClientBLL(); this.clients = business.Get(); this.ddlClient.DataSource = this.clients; this.ddlClient.DataValueField = "DocumentId"; this.ddlClient.DataTextField = "FullDescription"; this.ddlClient.DataBind(); }
//Metodo encargado de llenar el DropDown public void dropdownClientes_ServerClick(object e, EventArgs args) { Client client = new Client(); //Variable de session int IdUsuario = Convert.ToInt32(Session["Usuario"]); //Carga de informacion de mi dropdown DropClient.DataValueField = "Id"; DropClient.DataTextField = "Cliente"; DropClient.DataSource = ClientBLL.BuscarClienteBLL(IdUsuario); DropClient.DataBind(); }
public FormRegisterSale() { InitializeComponent(); _clientBLL = new ClientBLL(); _checkinBLL = new CheckInBLL(); _checkIn = new CheckIn(); _roomBLL = new RoomBLL(); _productBLL = new ProductBLL(); _saleBLL = new SaleBLL(); _product = new Product(); _saleItems = new List <SaleItem>(); ClearNameProduct(); }