internal override string Execute(string[] parameters) { int oldFolderID; int newFolderID; int userID; List <int> channelIDList; string error = Helper.GetIDsMove(_session, parameters, out userID, out oldFolderID, out newFolderID, out channelIDList); if (error != "1") { return(error); } BLClient client = null; try { client = new BLClient(); client.MovePCChannels(userID, oldFolderID, newFolderID, channelIDList); } catch (Exception ex) { return(ErrorWrapper.SendError(ex.Message)); } finally { client.Dispose(); } return("1"); }
public ClientAddressForm(int _id) { id = _id; InitializeComponent(); BLAddress bLAddress = new BLAddress(); dataGridClientAddress.DataSource = bLAddress.Address(id); BLClient bLClient = new BLClient(); ClientModule client = new ClientModule(); client = bLClient.GetClientList(id, "", "", "", "", "")[0]; txtClientName.Text = client.ClientName; txtClientSurname.Text = client.ClientSurname; txtClientCode.Text = client.ClientCode; txtEmail.Text = client.Email; txtPhoneNo.Text = client.PhoneNo; dataGridClientAddress.Columns["ClientId"].Visible = false; dataGridClientAddress.Columns["ClientAddressId"].Visible = false; dataGridClientAddress.Columns["ClientName"].Visible = false; dataGridClientAddress.Columns["ClientSurname"].Visible = false; dataGridClientAddress.Columns["CityName"].HeaderText = "Oras"; dataGridClientAddress.Columns["CountyName"].HeaderText = "Judet"; dataGridClientAddress.Columns["StreetName"].HeaderText = "Nume Strada"; dataGridClientAddress.Columns["StreetNo"].HeaderText = "Numar Strada"; dataGridClientAddress.Columns["status"].Visible = false; dataGridClientAddress.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; }
private void BtnFilterPartner_Click(object sender, EventArgs e) { lblMessage.Text = "Selectati un client pentru a modifica sau sterge.\n" + "Pentru a vedea, modifica sau sterge adresa, dublu click perandul clientului "; string clientName = txtClientName.Text; string clientSurname = txtClientSurname.Text; string clientCode = txtClientCode.Text; string phoneNo = txtPhoneNo.Text; string email = txtEmail.Text; //int id = null; BLClient bLGetClient = new BLClient(); List <ClientModule> list = bLGetClient.GetClientList(-1, clientName, clientSurname, clientCode, phoneNo, email); if (list.Count == 0) { MessageBox.Show("Nu sunt inregistrari cu parametrii introdusi!!!", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error); } dataGridClient.DataSource = list; dataGridClient.Columns["ClientId"].Visible = false; dataGridClient.Columns["ClientName"].HeaderText = "Nume Client"; dataGridClient.Columns["ClientSurname"].HeaderText = "Prenume Client"; dataGridClient.Columns["PhoneNo"].HeaderText = "Numar de telefon"; dataGridClient.Columns["Email"].HeaderText = "Email"; dataGridClient.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridClient.RowHeaderMouseDoubleClick += DataGridClient_RowHeaderMouseDoubleClick; //dataGridClient.RowHeaderMouseClick += DataGridClient_RowHeaderMouseClick; //dataGridClient.SelectedRows[0].Cells[0].Value; //dataGridClient.Columns.GetFirstColumn.Hide(); }
private void btnUpdate_Click(object sender, EventArgs e) { int id = 0; int.TryParse(tbId.Text, out id); if (id != 0) { Project currentProject = BLProject.GetProjectById(APCContext, id); if (currentProject != null) { currentProject.Name = tbName.Text; int currentClientId = 0; int.TryParse(cbClient.SelectedValue.ToString(), out currentClientId); Client currentClient = BLClient.GetClientById(APCContext, currentClientId); currentProject.Client = currentClient; APCContext.SaveChanges(); ClearContent(); MessageBox.Show("Project Details Successfully Updated"); } else { MessageBox.Show("Project Id not found"); } } else { MessageBox.Show("Project Id not found"); } }
public void OnClick_Next(object sender, EventArgs e) { if (!_emailRegex.IsMatch(txtEmail.Text)) { rfvEmail.Visible = true; return; } else { rfvEmail.Visible = false; } BLClient client = null; try { client = new BLClient(); client.SendContactEmail(txtName.Text, txtEmail.Text, ddlSubject.SelectedValue, txtMessage.Text); } finally { if (client != null) { client.Dispose(); } } Response.Redirect("ContactUsThanks.aspx"); }
public List <Project> searchById(int id) { if (id != 0) { List <Project> projectList = BLProject.GetProjectListById(APCContext, id); if (projectList != null) { tbId.Text = projectList[0].Id.ToString(); tbName.Text = projectList[0].Name; Client currentClient = BLClient.GetClientByName(APCContext, projectList[0].Client.Name)[0]; cbClient.SelectedValue = currentClient.Id; return(projectList); } else { MessageBox.Show("Project Id not found"); } } else { MessageBox.Show("Project Id not found"); } return(null); }
internal override string Execute(NameValueCollection commandParameters) { int userID; if (!Helper.TryGetUserID(_session, out userID)) { return(String.Empty); } List <List <CreateContentGenericFolder> > folderList; BLClient client = null; try { client = new BLClient(); folderList = client.GetFolders(userID); } catch (Exception exception) { return(ErrorWrapper.SendError(exception.Message)); } finally { if (client != null) { client.Dispose(); } } return(Flatten(folderList)); }
internal override string Execute(string[] parameters) { int userID; if (!Helper.TryGetUserID(_session, out userID)) { return(String.Empty); } if (parameters.Length < 2) { return(ErrorWrapper.SendError("Command parameters missing.")); } BLClient client = null; int pcID; try { client = new BLClient(); pcID = client.AddPC(userID, parameters[1]); } catch (Exception ex) { return(ErrorWrapper.SendError(ex.Message)); } finally { client.Dispose(); } return(pcID.ToString()); }
private void btnDelete_Click(object sender, EventArgs e) { int id = 0; int.TryParse(tbId.Text, out id); if (id != 0) { Client currentClient = BLClient.GetClientById(APCContext, id); if (currentClient != null) { APCContext.DeleteObject(currentClient); APCContext.SaveChanges(); MessageBox.Show("Delete Successfully"); ClearContent(); } else { MessageBox.Show("Client Id not found"); } } else { MessageBox.Show("Client Id not found"); } }
private void btnUpdate_Click(object sender, EventArgs e) { int id = 0; int.TryParse(tbId.Text, out id); if (id != 0) { Client currentClient = BLClient.GetClientById(APCContext, id); if (currentClient != null) { currentClient.Name = tbClientName.Text; APCContext.SaveChanges(); MessageBox.Show("Client Details Successfully Updated"); ClearContent(); } else { MessageBox.Show("Client Id not found"); } } else { MessageBox.Show("Client Id not found"); } }
private void GetChannels() { PagedDataSource pds = new PagedDataSource(); BLClient client = null; try { client = new BLClient(); pds.DataSource = client.GetChannelListByLetter(_activeLetter, _sort); } finally { client.Dispose(); } pds.AllowPaging = true; pds.PageSize = _pageSize; pds.CurrentPageIndex = CurrentPage; Prev.Visible = !pds.IsFirstPage; Next.Visible = !pds.IsLastPage; channelList.DataSource = pds; channelList.DataBind(); List <int> pageNumbers = CreatePageLinks(pds); pages.DataSource = pageNumbers; pages.DataBind(); }
internal override string Execute(System.Collections.Specialized.NameValueCollection commandParameters) { int userID; if (!Helper.TryGetUserID(_session, out userID)) { return(String.Empty); } BLClient client = null; List <ChannelSimple> channels = null; try { client = new BLClient(); channels = client.GetChannelsAll(userID); } catch (Exception exception) { return(ErrorWrapper.SendError(exception.Message)); } finally { if (client != null) { client.Dispose(); } } return(Flatten(channels)); }
internal override string Execute(string[] parameters) { int folderID; int userID; List <int> contentIDList; string error = Helper.GetIDs(_session, parameters, out userID, out folderID, out contentIDList); if (error != "1") { return(error); } BLClient client = null; try { client = new BLClient(); client.AddSlideContent(userID, folderID, contentIDList); } catch (Exception ex) { return(ErrorWrapper.SendError(ex.Message)); } finally { client.Dispose(); } return("1"); }
internal override string Execute(NameValueCollection commandParameters) { int channelID; string error = ValidateIntParameter(commandParameters, "channelId", out channelID); if (error != string.Empty) { return(error); } Channel channel = null; BLClient client = null; try { client = new BLClient(); channel = client.GetChannelDetailsSimple(channelID); } catch (Exception exception) { return(ErrorWrapper.SendError(exception.Message)); } finally { if (client != null) { client.Dispose(); } } return(Flatten(channel)); }
public void DeleteAccount_Click(object sender, EventArgs e) { BLClient client = null; bool bHasActivePCs = false; try { client = new BLClient(); bHasActivePCs = client.RemoveUserAccount(((User)Session["User"]).UserID); } finally { if (client != null) { client.Dispose(); } } if (bHasActivePCs) { ValidationMessage.Text = "Please uninstall your software before deleting your account."; return; } // deletion successful Session.Remove("User"); Response.Redirect("Home.aspx"); }
public void SaveClient() { if (this.clientId == 0) { int idInserted = 0; BLClient bip = new BLClient(); string info = bip.InsertClientBI(txtClientName.Text, txtClientSurName.Text, txtClientCode.Text, txtClientPhone.Text, txtClientEmail.Text, out idInserted); this.clientId = idInserted; if (String.IsNullOrEmpty(info)) { foreach (ClientAddressModel model in listAddress) { model.ClientId = idInserted; } BLClientAddress bla = new BLClientAddress(); bla.BIPrepareClientAddress(listAddress); MessageBox.Show("Clientul a fost inserat cu succes", "Succes", MessageBoxButtons.OK, MessageBoxIcon.None); } else { MessageBox.Show(info, "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } else { bool ok; this.clientCodeFinal = txtClientCode.Text; if (clientCodeInitial == clientCodeFinal) { ok = true; } else { ok = false; } BLClient bl = new BLClient(); string info = bl.BIUpdateClient(txtClientName.Text, txtClientSurName.Text, txtClientCode.Text, txtClientPhone.Text, txtClientEmail.Text, clientId, ok); if (String.IsNullOrWhiteSpace(info)) { BLClientAddress bla = new BLClientAddress(); bla.BIPrepareClientAddress(listAddress); MessageBox.Show("Datele clientului au fost modificate cu succes", "Succes", MessageBoxButtons.OK, MessageBoxIcon.None); this.clientCodeInitial = this.clientCodeFinal; } else { MessageBox.Show(info, "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } }
//public invoicedetailform(int _id, int _userid) //{ // initializecomponent(); // userid = _userid; // invoiceid = _id; // blclient blclient = new blclient(); // cmbclientfullname.datasource = blclient.getclientfullname(0); // cmbclientfullname.displaymember = "clientfullname"; //} public InvoiceDetailForm(int _id, int _userId) { InitializeComponent(); //userId = _userId; invoiceId = _id; userId = _userId; BLInvoice bLInvoice = new BLInvoice(); List <DisplayInvoiceModel> list = bLInvoice.GetDisplayInvoice(invoiceId, "", DateTime.Now, DateTime.Now, ""); DisplayInvoiceModel displayInvoiceModel = new DisplayInvoiceModel(); if (list.Count > 0) { displayInvoiceModel = list[0]; } //txtAddress.Text = displayInvoiceModel.Address; //txtClientFullName.Text = displayInvoiceModel.ClientFullName; txtInvoiceNumber.Text = displayInvoiceModel.InvoiceNumber; dateInvoice.Value = (displayInvoiceModel.InvoiceDate == DateTime.Parse("1/1/0001 12:00:00 AM")) ? DateTime.Now : displayInvoiceModel.InvoiceDate; BLClient bLClient = new BLClient(); List <ClientFullNameModel> clients = bLClient.GetClientFullName(0); cmbClientFullName.DataSource = clients; ClientFullNameModel clientFullName = bLClient.GetClientFullName(displayInvoiceModel.ClientId)[0]; //int index = clients.IndexOf(clientFullName); int index = clients.FindIndex(a => a.ClientId == clientFullName.ClientId); cmbClientFullName.SelectedIndex = index; //MessageBox.Show(cmbClientFullName.SelectedIndex.ToString()); //cmbClientFullName. //MessageBox.Show(cmbClientFullName.SelectedItem.ClientId); //cmbClientFullName. cmbClientFullName.DisplayMember = "ClientFullName"; //cmbClientFullName.DisplayMember = "ClientSurname"; //txtInvoiceDate.Text = displayInvoiceModel.InvoiceDate.Year.ToString()+"-"+ displayInvoiceModel.InvoiceDate.Month.ToString()+"-"+ displayInvoiceModel.InvoiceDate.Day.ToString(); txtObservations.Text = displayInvoiceModel.Observations; BLInvoiceDetail bLInvoiceDetail = new BLInvoiceDetail(); dataGridDetails.DataSource = bLInvoiceDetail.GetInvoiceDetail(invoiceId); dataGridDetails.Columns["InvoiceDetailId"].Visible = false; dataGridDetails.Columns["ItemId"].Visible = false; dataGridDetails.Columns["InvoiceId"].Visible = false; dataGridDetails.Columns["Status"].Visible = false; dataGridDetails.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; }
protected void BtDisable_Click(object sender, EventArgs e) { BLClient blcAvailable = new BLClient(); string[] words = List_User.SelectedItem.ToString().Split(); blcAvailable.enableStateDish(words[1], false); chargeList(); }
protected void Page_Load(object sender, EventArgs e) { int userID = -1; int channelID; Helper.TryGetUserID(Session, out userID); if (Request.Params["channelID"] == null) { Response.Redirect("~/AllChannels.aspx"); } if (!int.TryParse(Request.Params["channelID"], out channelID)) { Response.Redirect("~/AllChannels.aspx"); } BLClient client = null; try { client = new BLClient(); _channel = client.GetChannelDetailsFull(userID, channelID); } finally { client.Dispose(); } if (Request.QueryString["a"] == null) { var installerSetup = new InstallerSetup(); installerSetup.Add((int)_channel.ChannelID, _channel.ChannelGUID, _channel.ChannelName, 10); Response.RedirectPermanent(Url.For(installerSetup), true); } ChannelName1.Text = _channel.ChannelName; ChannelName2.Text = _channel.ChannelName; ChannelName3.Text = _channel.ChannelName; PublisherName.Text = _channel.PublisherDisplayName; NoContents.Text = _channel.NoContents.ToString(); ShortDescription.Text = string.IsNullOrEmpty(_channel.ChannelDescription) ? "No description available" : _channel.ChannelDescription; LongDescription.Text = string.IsNullOrEmpty(_channel.ChannelLongDescription) ? "<p>No description available</p>" : "<p>" + Helper.FirstWords(_channel.ChannelLongDescription, 120).Replace("\r\n", "</p><p>") + "</p>"; NoFollowers.Text = _channel.NoFollowers.ToString(); AddDate.Text = _channel.AddDate.ToShortDateString(); ContentLastAddedDate.Text = _channel.ContentLastAddedDate.ToShortDateString(); PreviewLiteral.Visible = _channel.PrivacyStatus != ChannelPrivacyStatus.Locked; _noSlides = _channel.Slides.Count; addStreamLink.NavigateUrl = "~/Download.aspx?channelID=" + channelID + "_strm"; ChannelSlides.DataSource = _channel.Slides; ChannelSlides.DataBind(); }
public void chargeList() { BLClient blcAvailable = new BLClient(); List <String> list = blcAvailable.ListUserClient(); List_User.Items.Clear(); foreach (string item in list) { List_User.Items.Add(item); } }
private void BtnFilter_Click(object sender, EventArgs e) { BLClient bl = new BLClient(); this.total_row = bl.BLGetTotalRow(txtName.Text, txtSurName.Text, txtClientCode.Text); this.total_page = (this.total_row / this.take_page) + 1; this.final_page = this.total_row % this.take_page; dataPartners.Rows.Clear(); this.currentpage = 1; this.skip_page = 0; PaginationDataGridView(); }
public async void GetBalance_NotExistingClient_ThrowsException() { //Arrange var bl = new BLClient(mockedReservationRepository, mockedClientRepository); var clientId = 5; //Act async Task act() => await bl.GetBalanceAsync(clientId); //Assert await Assert.ThrowsAsync <CustomException>(act); }
private void btnInsert_Click(object sender, EventArgs e) { if (BLClient.insertClient(APCContext, tbClientName.Text)) { MessageBox.Show("Client Successfully Added"); ClearContent(); } else { MessageBox.Show("Please check your input"); } }
private void CmbBoxClient_DropDown(object sender, EventArgs e) { BLClient bLClient = new BLClient(); BindingList <ClientModel> lista = new BindingList <ClientModel>(); lista = bLClient.ClientList(); var source = new BindingSource(lista, null); cmbBoxClient.ValueMember = "ClientId"; cmbBoxClient.DisplayMember = "Fullname"; cmbBoxClient.DataSource = source; }
protected void Page_Load(object sender, EventArgs e) { string sortBy = null; if (Request.QueryString["active"] == null) { _activeLetter = "A"; } else { _activeLetter = Request.QueryString["active"]; } if (Request.QueryString["sortBy"] == null) { sortBy = "a"; } else { sortBy = Request.QueryString["sortBy"]; } _sort = TryParseSortChannelsBy(sortBy); GetSortingLinks(); BLClient client = null; // access the DB for most popular channels and bind "most popular" once if (!Page.IsPostBack) { try { client = new BLClient(); MostPopular.DataSource = client.GetChannelMostPopular(); MostPopular.DataBind(); } finally { client.Dispose(); } GetChannels(); } Panel activeLetterPanel = GetActivePanel(_activeLetter); AddSortingInfoToAlphabet(sortBy); activeLetterPanel.CssClass = "ActiveLetter"; }
private void PaginationDataGridView() { BLClient bl = new BLClient(); BindingList <ClientModel> list = bl.GetClientBi(txtName.Text, txtSurName.Text, txtClientCode.Text, null, skip_page, take_page); foreach (ClientModel client in list) { dataPartners.Rows.Add(client.ClientId, client.ClientName, client.ClientSurname, client.ClientCode, client.PhoneNo, client.Email); } lblPage.Text = this.currentpage.ToString() + "/" + this.total_page.ToString(); txtTotalPage.Text = this.total_page.ToString(); }
public List <BLClient> UserLoginValidation(string email, string password) { List <BLClient> clientFound = new List <BLClient>(); BLClient blCl = new BLClient(); BLClient blClFound = blCl.GetUserLoginValidation(email, password); if (blClFound != null) { clientFound.Add(blClFound); } return(clientFound); }
internal override string Execute(string[] parameters) { int slideFolderID; int slideID; int userID; if (!Helper.TryGetUserID(_session, out userID)) { return(String.Empty); } if (parameters.Length < 3) { return(ErrorWrapper.SendError("Command parameters missing.")); } if (!int.TryParse(parameters[1], out slideFolderID)) { return(ErrorWrapper.SendError("Cannot parse Slide Folder ID")); } if (!int.TryParse(parameters[2], out slideID)) { return(ErrorWrapper.SendError("Cannot parse Slide ID")); } BLClient client = null; bool bCanRemove = false; try { client = new BLClient(); bCanRemove = client.RemoveSlideContent(userID, slideFolderID, slideID); } catch (Exception ex) { return(ErrorWrapper.SendError(ex.Message)); } finally { client.Dispose(); } if (!bCanRemove) { return("-1"); } return("1"); }
internal override string Execute(string[] parameters) { int userID; int pcID; int channelID; int channelWeighting; if (!Helper.TryGetUserID(_session, out userID)) { return(String.Empty); } if (parameters.Length < 4) { return(ErrorWrapper.SendError("Command parameters missing.")); } if (!int.TryParse(parameters[1], out pcID)) { return(ErrorWrapper.SendError("Cannot parse PC ID.")); } if (!int.TryParse(parameters[2], out channelID)) { return(ErrorWrapper.SendError("Cannot parse Channel ID.")); } if (!int.TryParse(parameters[3], out channelWeighting)) { return(ErrorWrapper.SendError("Cannot parse Channel Weighting.")); } BLClient client = null; try { client = new BLClient(); client.EditChannelWeighting(userID, pcID, channelID, channelWeighting); } catch (Exception ex) { return(ErrorWrapper.SendError(ex.Message)); } finally { client.Dispose(); } return("1"); }
internal override string Execute(string[] parameters) { int userID; int assetContentFolderID; int assetContentID; if (!Helper.TryGetUserID(_session, out userID)) { return(String.Empty); } if (parameters.Length < 3) { return(ErrorWrapper.SendError("Command parameters missing.")); } if (!int.TryParse(parameters[1], out assetContentFolderID)) { return(ErrorWrapper.SendError("Cannot parse raw content folder ID.")); } if (!int.TryParse(parameters[2], out assetContentID)) { return(ErrorWrapper.SendError("Cannot parse raw content ID.")); } BLClient client = null; int fileLength = -1; try { client = new BLClient(); fileLength = client.RemoveAssetContent(userID, assetContentFolderID, assetContentID); } catch (Exception ex) { return(ErrorWrapper.SendError(ex.Message)); } finally { client.Dispose(); } if (fileLength != -1) { ((User)_session["User"]).UsedBytes -= fileLength; } return("1"); }