Search Results

Search found 7104 results on 285 pages for 'dynamic usercontrols'.

Page 87/285 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • Dynamic swappable Data Access Layer

    - by Andy
    I'm writing a data driven WPF client. The client will typically pull data from a WCF service, which queries a SQL db, but I'd like the option to pull the data directly from SQL or other arbitrary data sources. I've come up with this design and would like to hear your opinion on whether it is the best design. First, we have some data object we'd like to extract from SQL. // The Data Object with a single property public class Customer { private string m_Name = string.Empty; public string Name { get { return m_Name; } set { m_Name = value;} } } Then I plan on using an interface which all data access layers should implement. Suppose one could also use an abstract class. Thoughts? // The interface with a single method interface ICustomerFacade { List<Customer> GetAll(); } One can create a SQL implementation. // Sql Implementation public class SqlCustomrFacade : ICustomerFacade { public List<Customer> GetAll() { // Query SQL db and return something useful // ... return new List<Customer>(); } } We can also create a WCF implementation. The problem with WCF is is that it doesn't use the same data object. It creates its own local version, so we would have to copy the details over somehow. I suppose one could use reflection to copy the values of similar fields across. Thoughts? // Wcf Implementation public class WcfCustomrFacade : ICustomerFacade { public List<Customer> GetAll() { // Get date from the Wcf Service (not defined here) List<WcfService.Customer> wcfCustomers = wcfService.GetAllCustomers(); // The list we're going to return List<Customer> customers = new List<Customer>(); // This is horrible foreach(WcfService.Customer wcfCustomer in wcfCustomers) { Customer customer = new Customer(); customer.Name = wcfCustomer.Name; customers.Add(customer); } return customers; } } I also plan on using a factory to decide which facade to use. // Factory pattern public class FacadeFactory() { public static ICustomerFacade CreateCustomerFacade() { // Determine the facade to use if (ConfigurationManager.AppSettings["DAL"] == "Sql") return new SqlCustomrFacade(); else return new WcfCustomrFacade(); } } This is how the DAL would typically be used. // Test application public class MyApp { public static void Main() { ICustomerFacade cf = FacadeFactory.CreateCustomerFacade(); cf.GetAll(); } } I appreciate your thoughts and time.

    Read the article

  • C# Dynamic IF Else Statment [closed]

    - by Tan Liang Liang
    allrowcol[i] = rowcol + "||"; Is it possible to put : if (loop == allrowcol.ToString()) If not, how can I place a few values inside an if statement? I need to have a few values in the if, and this value is generated from a text file. e.g. if(loop==11||14||15||16") My array for the allrowcol.ToString() is "11||14||15||16||". rowcol is the number that I extract from my text file. But my if (read as a whole string). What can I do?

    Read the article

  • C++ Dynamic object construction

    - by Rajesh Subramanian
    I have a base class, class Msg { ParseMsg() { ParseMsgData(); ParseTrailer(); } virtual void ParseMsgData() = 0; ParseTrailer(); }; and derived classes, class InitiateMsg { void ParseMsgData() { ... } }; class ReadOperationMsg { void ParseMsgData() { ... } }; class WriteOperationMsg { void ParseMsgData() { ... } }; and the scenario is below, void UsageFunction(string data) { Msg* msg = ParseHeader(data); ParseMsg } Msg* ParseHeader(string data) { Msg *msg = NULL; .... switch() { case 1: msg = new InitiateMsg(); break; case 2: msg = new ReadOperationMsg{(); break; case 3: msg = new WriteOperationMsg{(); break; .... } return msg; } based on the data ParseHeader method will decide which object has to be created, So I have implemented ParseHeader function outside the class where I am using. How can I make the ParseHeader function inside the Msg class and then use it? In C# the same is achieved by defining ParseHeader method as static with in class and use it from outside,

    Read the article

  • Dynamic content in a Gridview

    - by mariki
    I have a gridview with couple of columns,I want to achieve the following: If user is NOT authorized display normal columns. If user IS authorized: set mouseover event for first column text and display some buttons (that are not available for NOT authorized users) in a second column when user hover over(using javascript) the first column. I am have 2 difficulties: The first one where and when should I create the buttons? I have 2 options, I can create those button on design time, in gridviews template and just set Visible value to false and then in codebehind set it to true if user is authorized. The second option would be creating this buttons dynamically in gridview_RowCreated event (or any other event) if user is authorized. The Second difficulty is setting the javascript event to show the buttons, the event should be added only if user is authorized! Note that event and buttons should have some kind of id match for Javascript function to know what should it hide/unhide when event is triggered. What should I do, what is the best practice? I know this is a long question, but please try to help :)

    Read the article

  • CC.NET File merge task and dynamic values

    - by ccnet
    How can I use CCNetLabel in the file merge task? From what I have found I have to use dynamicValues. I have somethink like this and it is not working any help? <publishers> <merge> <dynamicValues> <replacementValue property="files"> <format>D:\Testoutput\{0}\*.xml</format> <parameters> <namedValue name="$CCNetLabel" value="Default" /> </parameters> </replacementValue> </dynamicValues> </merge> <xmllogger /> <modificationHistory onlyLogWhenChangesFound="true" /> <statistics /> </publishers>

    Read the article

  • C++ dynamic array causes segmentation fault at assigment

    - by opc0de
    I am doing a application witch uses sockets so I am holding in an array the sockets handles.I have the following code: while(0 == 0){ int * tx = (int*)(malloc((nr_con + 2) * sizeof(int))); if (conexiuni != NULL) { syslog(LOG_NOTICE,"Ajung la eliberare %d",nr_con); memcpy(&tx[0],&conexiuni[0],(sizeof(int) * (nr_con))); syslog(LOG_NOTICE,"Ajung la eliberare %d",nr_con); free(conexiuni); } conexiuni = tx; syslog(LOG_NOTICE,"Ajung la mama %d",nr_con); //The line bellow causes a segfault at second connection if ((conexiuni[nr_con] = accept(hsock,(sockaddr*)(&sadr),&addr_size)) != -1) { nr_con++; syslog(LOG_NOTICE,"Primesc de la %s",inet_ntoa(sadr.sin_addr)); syslog(LOG_NOTICE,"kkt %d",conexiuni[nr_con - 1]); int * sz = (int*)malloc(sizeof(int)); *sz = conexiuni[nr_con - 1]; syslog(LOG_NOTICE,"after %d",*sz); pthread_create(&tidi,0,&ConexiuniHandler, sz); } } When I connect the second time when I assign the array the program crashes. What am I doing wrong? I tried the same code on Windows and it works well but on Linux it crashes.

    Read the article

  • jQuery Validator - Dynamic Text

    - by James
    Adding a validator to my form: jQuery.validator.addMethod('whatever', function(val, el) { // whatever goes here }, 'A maximum of ' + $('#my_id_here').val() + ' categories can be selected.'); This doesn't fly. I always get undefined. Is this a good, simple way to do this? Thanks

    Read the article

  • jQuery Scrollable Dynamic

    - by Coron3r
    Hi, I am doing a site where I need to change dynamically the amount of items in one slide depending on the resolution. I'm using the Jquery Tools scrollable For better understanding, here is the basic markup <div class="scrollable"> <!-- root element for the items --> <div class="items"> <!-- 1-5 --> <div> <img src="http://farm1.static.flickr.com/143/321464099_a7cfcb95cf_t.jpg" /> <img src="http://farm4.static.flickr.com/3089/2796719087_c3ee89a730_t.jpg" /> <img src="http://farm1.static.flickr.com/79/244441862_08ec9b6b49_t.jpg" /> <img src="http://farm1.static.flickr.com/28/66523124_b468cf4978_t.jpg" /> <img src="http://farm1.static.flickr.com/164/399223606_b875ddf797_t.jpg" /> </div> <!-- 5-10 --> <div> <img src="http://farm1.static.flickr.com/163/399223609_db47d35b7c_t.jpg" /> <img src="http://farm1.static.flickr.com/135/321464104_c010dbf34c_t.jpg" /> <img src="http://farm1.static.flickr.com/40/117346184_9760f3aabc_t.jpg" /> <img src="http://farm1.static.flickr.com/153/399232237_6928a527c1_t.jpg" /> <img src="http://farm1.static.flickr.com/50/117346182_1fded507fa_t.jpg" /> </div> <!-- 10-15 --> <div> <img src="http://farm4.static.flickr.com/3629/3323896446_3b87a8bf75_t.jpg" /> <img src="http://farm4.static.flickr.com/3023/3323897466_e61624f6de_t.jpg" /> <img src="http://farm4.static.flickr.com/3650/3323058611_d35c894fab_t.jpg" /> <img src="http://farm4.static.flickr.com/3635/3323893254_3183671257_t.jpg" /> <img src="http://farm4.static.flickr.com/3624/3323893148_8318838fbd_t.jpg" /> </div> </div> </div> Ok and now I would like to set, that if I have a resolution bellow 1440, I would show only e.g. 3 images <div class="scrollable"> <!-- root element for the items --> <div class="items"> <!-- 1-3 --> <div> <img src="http://farm1.static.flickr.com/143/321464099_a7cfcb95cf_t.jpg" /> <img src="http://farm4.static.flickr.com/3089/2796719087_c3ee89a730_t.jpg" /> <img src="http://farm1.static.flickr.com/79/244441862_08ec9b6b49_t.jpg" /> </div> <!-- 3-6 --> <div> <img src="http://farm1.static.flickr.com/163/399223609_db47d35b7c_t.jpg" /> <img src="http://farm1.static.flickr.com/135/321464104_c010dbf34c_t.jpg" /> <img src="http://farm1.static.flickr.com/40/117346184_9760f3aabc_t.jpg" /> </div> ..etc </div> </div> I know that I should use the screen.width(); function but how to slice and parse it depending on the resolution? Thanks for your comments!

    Read the article

  • Nested Dynamic PHP Class

    - by user338844
    Alright, I may just need a terminology update, but I have been playing in Magento and Joomla, and they do references like $mage = new Mage; $mage->block('blockname'); where class Mage through some process I am failing to figure out is calling: class blockname extends something{ } Don't quote me on that code, however I am looking to do something like that where I have a file that I can do $myscript-block('blockname'); and it will load and call the file with class blockname. I hope that is not too confusing, but any help is appreciated. Thanks in advance!

    Read the article

  • Dynamic Column lookup with different pages in excel

    - by CinCity
    I have a multi page spread sheet in excel that needs to read information dynamically from columns on other pages and have these values show up on a main page. This is the formula I'm using: =IF(VLOOKUP($B:$B,'CP01'!$B:$BN,3,FALSE)="r","r", IF(VLOOKUP($B:$B,'CP01'!$B:$BN,3,FALSE)="a","a","")) CP01 is a sheet in the excel file and instead of look at the specific sheet I want it to look at all of the sheets in the file. Is there a way to do this as an excel formula or with excel-VBA? Edit: I also tried CP* (* being a wildcard character) and it didn't work. Edit2: Is there a way to match the value where the 'CP' is placed with its a other columns value?

    Read the article

  • Linq-to-Entities Dynamic sorting

    - by verror
    This is my query, how can I use string as orderby parameter? string sortColumn="Title"; var items = (from ltem in ctxModel.Items where ltem.ItemID == vId orderby //something here select ltem).Skip(PageSize * PageIndex).Take(PageSize);

    Read the article

  • Dynamic Links in that auto navigates to the top of a div

    - by Dot Oyes
    I have a forum whereby links to a thread looks like http://www.website.com/comments.php?topic_id=1 How can I make it look like this http://www.website.com/1046302/some-link-desc#12154109 so that when such links are given out, the user is taken directly to that particular comment. I'm particular about the #12154109 . The other part of the URL /1046302/some-link-desc is achieved through .htaccess configuration.

    Read the article

  • Dynamic attached UILabel is not moving.

    - by coure06
    I have attached a UILabel to view. Now i want to move that label but its not working. here is my code UILabel *tick = (UILabel *)[self.view viewWithTag:tag]; CGRect frame = tick.frame; frame.origin.x = newVal; frame.origin.y = newVal; I can change text value of the UILabel tick but how can i move it here and there?

    Read the article

  • Smarty dynamic error list

    - by Brainscrewer
    Im new to Smarty in combination with PHP and I really like it. Unfortunatly im running into a problem while validating fields after a $_POST has been done. I've made an array called $errors and use that to save error messages in, for example: $errors[] .= "Wrong email";. My problem is in sending the $errors array over to the template so I can use it to display the error messages. My question: How do you 'transfer' the $errors variable over to the template file so you can use it there with, for example {foreach}. I was planning on doing something like {if $hasErrors} {foreach from=errors item=error} <li>{$error}</li> {/foreach} {/if} Thanks in advance

    Read the article

  • What is the best way to handle dynamic content_type in Sinatra

    - by lusis
    I'm currently doing the following but it feels "kludgy": module Sinatra module DynFormat def dform(data,ct) if ct == 'xml';return data.to_xml;end if ct == 'json';return data.to_json;end end end helpers DynFormat end My goal is to plan ahead. Right now we're only working with XML for this particular web service but we want to move over to JSON as soon as all the components in our stack support it. Here's a sample route: get '/api/people/named/:name/:format' do format = params[:format] h = {'xml' => 'text/xml','json' => 'application/json'} content_type h[format], :charset => 'utf-8' person = params[:name] salesperson = Salespeople.find(:all, :conditions => ['name LIKE ?', "%#{person}%"]) "#{dform(salesperson,format)}" end It just feels like I'm not doing it the best way possible.

    Read the article

  • How to check volume is mounted or not using python with a dynamic volume name

    - by SR query
    import subprocess def volumeCheck(volume_name): """This function will check volume name is mounted or not. """ volume_name = raw_input('Enter volume name:') volumeCheck(volume_name) print 'volume_name=',volume_name p = subprocess.Popen(['df', '-h'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) p1, err = p.communicate() pattern = p1 if pattern.find(volume_name): print 'volume found' else: print 'volume not found' While running i always got wrong result "volume found". root@sr-query:/# df -h Filesystem Size Used Avail Use% Mounted on rootfs 938M 473M 418M 54% / /dev/md0 938M 473M 418M 54% / none 250M 4.9M 245M 2% /dev /dev/md2 9.7M 1.2M 8.0M 13% /usr/config /dev/md7 961M 18M 895M 2% /downloads tmpfs 250M 7.9M 242M 4% /var/volatile tmpfs 250M 0 250M 0% /dev/shm tmpfs 250M 0 250M 0% /media/ram **/dev/mapper/vg9-lv9 1016M 65M 901M 7% /VolumeData/sp /dev/mapper/vg10-lv10 1016M 65M 901M 7% /VolumeData/cp** root@sr-query:/# root@sr-query:/# root@sr-query:/# python volume_check.py Enter volume name:raid_10volume volume_name= raid_10volume **volume found** root@sr-query:/# I enterd raid_10volume its not listed here please check the df -h command out put(only 2 volume there sp and cp) , then how it reached else part. what is wrong in my code? Thanks in advance. is there any other way to do this work ! ?

    Read the article

  • CodeIgniter URI routing (dynamic, multilingual)

    - by koteko
    I'm trying to redirect all routs to one main controller. Here is my routes.php $route['default_controller'] = "main"; $route['scaffolding_trigger'] = ""; //$route['(\w{2})/(.*)'] = '$2'; //$route['(\w{2})'] = $route['default_controller']; $route['(en|ge)/(:any)'] = $route['default_controller']."/index/$1"; $route['(:any)'] = $route['default_controller']."/index/$1"; I need language id to be passed with every link (like: http://site.com/en/hello-world) Here is my main controller: class Main extends Controller { function __construct() { parent::Controller(); } function index($page_type=false, $param=false) { die($page_type.' | '.$param.'| Aaa!'); } } I want to check if predefined file type exists (like: http://site.com/en/archive/05-06-2010 - here predefined type would be archive) then do something. If not then search in the database for slug. If not found then go to 404. The problem is that I can't get index function parameters ($page_type, $param). Thanks for help.

    Read the article

  • [CakePHP] Dynamic fields on insert/edit form

    - by user198003
    hi all, let's say that i have 3 tables: books properties book_properties of course, i would like that when i want to insert new book (or update existing), to fill the form. fields that exist on form have to be defined as records in table properties. when i fill up those fields, data has to be saved in table book_properties. can you help me by giving some advices and references, how to achieve that? thank you very much in advance!

    Read the article

  • flash video dynamic width and height change in Action Script 3.0

    - by coderex
    hi I have a video player and the video file came from one xml file, The videos are in different dimension so how can i set the video dimension dynamically? _vid = new Video(); _vid.attachNetStream(_vidStream); How can i give the new dimension of the video, the default i get is http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Video.html Video(width:int = 320, height:int = 240) Creates a new Video instance. I need the height and width of the video, How

    Read the article

  • iOS dynamic object creation

    - by Abdul Ahmad
    I've worked with Xcode and iOS on a few personal projects and have always used non-object-oriented designs for everything... just because I've been doing mostly learning/experimenting with things. Now I've been trying to implement some object oriented design into one game I've made previously. The idea is, I have a space ship that can shoot bullets. In the past I basically added the UIImageView to the storyboard and then connected it to the .h file and from there did things on it like move it around or whatever (using CGPointMake). The idea now is to make a method (and a whole other class soon) that will create a UIImageView programmatically, allocate it, add it to the superview etc... I've got this working so far, easy stuff, but the next part is a bit harder. Where do I store this local variable "bullet"? I've been saving it to an NSMutableArray and doing the following: (actually here are the methods that I have) -(void)movement { for (int i = 0; i < [array1 count]; i ++) { UIImageView *a = [array1 objectAtIndex:i]; a.center = CGPointMake(a.center.x + 2, a.center.y); if (a.center.x > 500) { [array1 removeObjectAtIndex:i]; [a removeFromSuperview]; } } } -(void)getBullet { UIImageView *bullet = [[UIImageView alloc] initWithFrame:CGRectMake(ship.center.x + 20, ship.center.y - 2, 15, 3)]; bullet.image = [UIImage imageNamed:@"bullet2.png"]; bullet.hidden = NO; [self.view addSubview:bullet]; [array1 addObject:bullet]; } (by the way, array1 is declared in the .h file) and theres a timer that controls the movement method timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(movement) userInfo:nil repeats:YES]; first question is: what is the correct way of doing this? Storing a bullet for example until it is removed from the superview, should I store it another way? and another question is, when I remove a UIImageView from the superview, does that remove it from memory so its not using up system resources? Thank you for the help! (will update if I Think of other questions

    Read the article

  • Best web technology for building dynamic charts

    - by Ryan
    I need to build a custom designed bar chart that displays some simple data. Below are my requirements. Can anyone suggest the best web technology for my requirements. high browser compatibility ability to draw shapes ability to fill shapes with gradients ability to have onclick and onmouseover events for the different shapes (bars in the chart). Thanks guys. I was thinking of using svg but looking for suggestions.

    Read the article

  • CodeMirror Dynamic Syntax Validation

    - by rawr
    Been trying to decide between using CodeMirror or Ace editor. I've been leaning towards CodeMirror, however there's one feature of Ace that I really like and that is how it does syntax validation. So as I'm typing there can appear a warning or error icon in the left gutter area beside the line number, and when I hover over it it gives me a little description. Is there any way to get this functionality in CodeMirror? Specifically, I'm using the css mode for CodeMirror. It'd also be nice to be able to add in my own custom validation. Thanks.

    Read the article

  • LINQ To SQL Dynamic Select

    - by mcass20
    Can someone show me how to indicate which columns I would like returned at run-time from a LINQ To SQL statement? I am allowing the user to select items in a checkboxlist representing the columns they would like displayed in a gridview that is bound to the results of a L2S query. I am able to dynamically generate the WHERE clause but am unable to do the same with the SELECT piece. Here is a sample: var query = from log in context.Logs select log; query = query.Where(Log => Log.Timestamp > CustomReport.ReportDateStart); query = query.Where(Log => Log.Timestamp < CustomReport.ReportDateEnd); query = query.Where(Log => Log.ProcessName == CustomReport.ProcessName); foreach (Pair filter in CustomReport.ExtColsToFilter) { sExtFilters = "<key>" + filter.First + "</key><value>" + filter.Second + "</value>"; query = query.Where(Log => Log.FormattedMessage.Contains(sExtFilters)); }

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >