Jump to content

Girish Dubey

Members
  • Posts

    28
  • Joined

  • Last visited

Posts posted by Girish Dubey

  1. How i can filter List the data with Dictionary condition using linq.

    class Person
    {
    	public string name
    	{
    		get; set;
    	}
    
    	public string subject
    	{
    		get; set;
    	}
    
    	public string type
    	{
    		get; set;
    	}
    
    	public int age
    	{
    		get; set;
    	}
    }
    
    class Test
    {
    	public void FindData()
    	{
    		// Create dictionary and add five keys and values.
    		var conditionDictionary = new Dictionary<string, string>();
    		conditionDictionary.Add("subject", "english");
    		conditionDictionary.Add("type", "teacher");
    		
    		List<Person> persons = new List<Person>();
    		persons.Add(new Person
    		{
    			name = "Rajul",
    			subject = "math",
    			type = "teacher",
    			age = 20
    		});
    		persons.Add(new Person
    		{
    			name = "Jhon",
    			subject = "english",
    			type = "teacher",
    			age = 25
    		});
    		persons.Add(new Person
    		{
    			name = "Nitin",
    			subject = "english",
    			type = "student",
    			age = 21
    		});
    		persons.Add(new Person
    		{
    			name = "Sumit",
    			subject = "english",
    			type = "teacher",
    			age = 26
    		});
    		persons.Add(new Person
    		{
    			name = "Komal",
    			subject = "science",
    			type = "student",
    			age = 29
    		});
    		
    		List<Person> filteredpersons = Filter(persons, conditionDictionary);
    	}
    
    	public List<Person> Filter(List<Person> persons, Dictionary<string, string> conditionDictionary)
    	{
          
          /*TODO: can you suggest how to filter list data using linq with Distionary*/
          
    		var list = (from person in persons
                            from condition in conditionDictionary
                            select person).ToList();
    		return list;
    	}
    }

     

  2. 10:55:57 10:55:57 C:\Builds\workspace\ci-job_master>"AutomatedProcedures\tools\nant-0.92\bin\nant.exe" -buildfile:AutomatedProcedures\NantScript.xml -D:Innovator.License.Type=Unlimited -D:Innovator.Activation.Key=xxxxxxxxxxxxxxxxxxxx-D:Innovator.License.Key=3c1bdb569c74585xxxxxxxxxxxxxxxxxxxxxx -D:MSSQL.Innovator.Password=**** -D:MSSQL.Innovator.Regular.Password=**** -D:MSSQL.SA.Password=**** -D:MSSQL.Server=. -D:Path.To.CodeTree.Zip=F:\Project\CIPro\CodeTreeSP12.zip -D:Path.To.DB.Bak=F:\Project\CIPro\CoreAndSolutions110_SP12DB.bak -D:Branch.Name=master ContinuousIntegration 10:55:59 NAnt 0.92 (Build 0.92.4543.0; release; 09-06-2012)10:55:59 Copyright (C) 2001-2012 Gerry Shaw*10:55:59* 
    http://nant.sourceforge.net
    10:55:59 10:56:01 Buildfile: 
    file:///C:/Builds/workspace/ci-job_master/AutomatedProcedures/NantScript.xml
    10:56:01 Target framework: Microsoft .NET Framework 4.0*10:56:01* Target(s) specified: ContinuousIntegration 10:56:01 10:56:03 [mkdir] Creating directory 'C:\Builds\workspace\ci-job_master\AutomatedProceduresOutput\TemporaryFilesAndLogs'.10:56:03 [include] Including file C:\Builds\workspace\ci-job_master\AutomatedProcedures\Default.Settings.include.10:56:03 [include] Including file C:\Builds\workspace\ci-job_master\AutomatedProcedures\Includes\NodeJs.include.10:56:03 [include] Including file C:\Builds\workspace\ci-job_master\AutomatedProcedures\Includes\MSBuild.include.10:56:03 [include] Including file C:\Builds\workspace\ci-job_master\AutomatedProcedures\Includes\ValidateEncoding.include.10:56:03 [include] Including file C:\Builds\workspace\ci-job_master\AutomatedProcedures\Includes\EnvironmentDiagnostics.include.10:56:04 [echo] SQL Server authentication will be used to access .10:56:06 10:56:06 Environment.Diagnostics:10:56:06 10:56:07 [echo] Version of node.js is v10.15.0*10:56:07* [echo] Version of C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe is 14.0*10:56:07* [echo] Windows version: Microsoft Windows [Version 10.0.17134.648]10:56:07 10:56:07Initialize.Validate.Task:10:56:07 10:56:11 [exec] Feeds used:10:56:11 [exec] 
    https://api.nuget.org/v3/index.json
    10:56:11 [exec] 10:56:23 [exec] Unable to load the service index for source 
    https://api.nuget.org/v3/index.json
    .10:56:23 [exec] An error occurred while sending the request.10:56:23 [exec] Unable to connect to the remote server*10:56:23* [exec] No connection could be made because the target machine actively refused it 127.0.0.1:5656*10:56:23* 10:56:23 BUILD FAILED - 0 non-fatal error(s), 4 warning(s)10:56:23 10:56:23 External Program Failed: C:\Builds\workspace\ci-job_master\AutomatedProcedures\tools\.nuget\NuGet.exe (return code was 1)10:56:23 10:56:23 Total time: 20.9 seconds.10:56:23

  3. How to call REST API using current instance of internet explorer. I am working on extension for fill the form dynamicly and data comes from REST API. but for authontation we have to login on that application e.g.

     

    REST API URL: http://dataservice.com/getusers.json

    Login page: http://dataservice.com/login.aspx

     

    and i wanted to fill data on another application

     

    Form page url: http://localservice.com/users.aspx

     

    and i have already logged in on http://dataservice.com domain and wanted to get data using internet explorer extension and fill form on second application which is available on different domain. 

    so can you suggest me how it can be possible through Internet Explorer extension.

  4. Sir i wanted to develop a extension for internet explorer 9 to fill opened form dynamically using extensition and the data i can configure in extension any time. so please suggest me how i can develop this extension step by step because i am new in explorer development. 

  5. On 3/31/2018 at 2:02 AM, Ingolme said:

    All I can recommend is to search for documentation that will help you build extensions.

    Here's documentation for Internet Explorer: https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa753620(v%3dvs.85)
    Here's documentation for Microsoft Edge: https://docs.microsoft.com/en-us/microsoft-edge/extensions/guides/creating-an-extension

    Internet Explorer is a complicated system to develop for, I would recommend building an extension in any other browser except Internet Explorer. Chrome is probably your best option for extensions because it is the most widely used browser and works on all platforms. If you were trying to build the same extension for all browsers, just build it for Edge instead of Internet Explorer.

    thanks for your replay.

    can you give me a link to develop a extension for fill form dynamically. and which editor i can use to develop. can i use visual studio 2015.

  6. I am trying to consume service using proxy class. i am getting below exception.

    "The underlying connection was closed: An unexpected error occurred on a receive."


     

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    
    //proxy class initialization
    ISessionManager objISessionManager = new SessionManagerClient("https://abcxyz.com/sessionmanager.svc");
    LogonRequest objLogonRequest = new LogonRequest();
    objLogonRequest.logonRequestData = new LogonRequestData();
    objLogonRequest.ContractVersion = APICredential.ContractVersion;
    objLogonRequest.logonRequestData.DomainCode = APICredential.AgentDomain;
    objLogonRequest.logonRequestData.AgentName = APICredential.AgentID;
    objLogonRequest.logonRequestData.Password = APICredential.Password;
    
    LogonResponse objLogonResponse = objISessionManager.Logon(objLogonRequest);
    

     

    can you suggest how we can fix it.

     

  7. I am trying to bind dynamic event but i am not able to bind. previously i have used .live in our system that was working find now we are going to migrate our system to jquery 3.1.1. and i have replace all .live to .on function but work. for you reference..

     

     

    <html>
    <head>
    <script src="jquery-3.1.1.min.js"></script>
    <!-- <script src="jquery-1.8.1.min.js"></script> -->
    <script>
    
    var abcHandler = function() {
    var h=this;
    h.getControl = function(cntrl) {
    return $("[class$='Cntrl_" + cntrl + "']");
    };
    h.main = h.getControl('main');
    h.divid1 = h.getControl('divid1');
    h.divid2 = h.getControl('divid2');
    }
    
    
    abcHandler.prototype.BindEvents = function() {
    var h=this;
    
    
    h.main.append("<a class='Cntrl_divid1' href='#'>View Details1</a><br />");
    h.main.append("<a class='Cntrl_divid2' href='#'>View Details2</a>");
    
    h.divid1.click(function () {
    alert(this.innerHTML);
    });
    
    h.divid2.click(function () {
    alert(this.innerHTML);
    });
    };
    
    
    var handler;
    $(document).ready(function() {
        handler = new abcHandler();
        handler.BindEvents();
    });
    
    
    </script>
    </head>
    <body>
    <div class="Cntrl_main">
    </div>
    </body>
    </html>
    
    

    Please suggest me how i can fix this issue.

     

     

    das

  8. I am trying to call a web service asynchronous in .net 4.0. I mean i don't want any kind of response from service side. I just want to execute a web method.

    can you suggest me how i can call?

     

     

     

    Service Code:

     

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Services;
    
    
    namespace UILAYER.Service
    {
        /// <summary>
        /// Summary description for TestService 
        /// </summary>
        [WebService(Namespace = "http://tempuri.org/")]
        [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
        [System.ComponentModel.ToolboxItem(false)]
        // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
        //[System.Web.Script.Services.ScriptService]
        public class TestService : System.Web.Services.WebService
        {
    
    
            int Message = "success||Record has been updated.";
    
    
            [WebMethod]
            public object ExecuteProcessRawRunches()
            {
                try
                {
                    if (Message.ToLower().StartsWith("success||"))
                    {
                        return new { Result = "OK", Records = Message };
                    }
                    else
                    {
                        return new { Result = "ERROR", Records = Message };
                    }
                }
                catch (Exception ex)
                {
                    return new { Result = "ERROR", Message = ex.Message };
                }
            }
        }
    }
  9. I compared and found both file's content were same but file extension were not same. When i downloaded from google chrome file extension was ".xls" but when i was downloaded from Mozilla file extension was ".xlsx".

     

    I param i passed a grid and file name with "Report Data.xls". From google chrome file name come with "Report Data.xls" but when Download from Mozilla file name come with "Report Data.xls.xlsx".

  10. I found some problem with below code when i am trying to export to excel using below code on IE and Mozilla Firefox. But sometime it works fine but sometime it works fine. So can you suggest me how i can resolve the problem?

     

    public static void ToExcel(GridView _grid, string FileName)
    {
    try
    {
    _grid.AllowPaging = false;
    PrepareGridViewForExport(_grid);
    string attachment = "attachment; filename=" + FileName + "";
    HttpContext.Current.Response.Clear();
    HttpContext.Current.Response.Buffer = true;
    HttpContext.Current.Response.BufferOutput = true;
    HttpContext.Current.Response.ClearContent();
    HttpContext.Current.Response.AddHeader("content-disposition", attachment);
    //HttpContext.Current.Response.ContentType = "application/ms-excel";//Excel 2003 //application/vnd.ms-excel
    HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";//Excel 2007
    StringWriter sw = new StringWriter();
    HtmlTextWriter htw = new HtmlTextWriter(sw);
    // Create a form to contain the grid
    htw.WriteLine(Heading);
    if (!string.IsNullOrEmpty(Company))
    {
    if (!Company.Contains("Select")) htw.WriteLine("<br/><b>Company : </b>" + Company);
    }
    if (!string.IsNullOrEmpty(Department))
    {
    if (!Department.Contains("Select"))
    htw.WriteLine("<br/><b>Department : </b>" + Department);
    }
    if (!string.IsNullOrEmpty(Region))
    {
    if (!Region.Contains("Select"))
    htw.WriteLine("<br/><b>Region : </b>" + Region);
    }
    htw.WriteLine("<br/><b>" + Heading + "</b> From <b>" + FromDate + "</b> To <b>" + ToDate + "</b> ");
    htw.WriteLine("<br/><br/>");
    HtmlForm frm = new HtmlForm();
    _grid.Parent.Controls.Add(frm);
    frm.Attributes["runat"] = "server";
    frm.Controls.Add(_grid);
    frm.RenderControl(htw);
    HttpContext.Current.Response.Write("<meta http-equiv=Content-Type content=text/html; charset=utf-8>" + Environment.NewLine);
    HttpContext.Current.Response.Write("HRMS Reports Sheet" + Environment.NewLine);
    HttpContext.Current.Response.Write(AddExcelStyling());
    HttpContext.Current.Response.Write(sw.ToString());
    HttpContext.Current.Response.Write("</body>");
    HttpContext.Current.Response.Write("</html>");
    HttpContext.Current.Response.Flush();
    HttpContext.Current.Response.End();
    }
    catch (Exception ex)
    {
    string str = ex.Message;
    }
    }

  11. C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>InstallUtil /i D:\HrmsAlertSvc\Hrm

    sAlertSvc.exe

    Microsoft ® .NET Framework Installation utility Version 4.0.30319.1

    Copyright © Microsoft Corporation. All rights reserved.



    Running a transacted installation.


    Beginning the Install phase of the installation.

    See the contents of the log file for the D:\HrmsAlertSvc\HrmsAlertSvc.exe assemb

    ly's progress.

    The file is located at D:\HrmsAlertSvc\HrmsAlertSvc.InstallLog.

    Installing assembly 'D:\HrmsAlertSvc\HrmsAlertSvc.exe'.

    Affected parameters are:

    logtoconsole =

    i =

    logfile = D:\HrmsAlertSvc\HrmsAlertSvc.InstallLog

    assemblypath = D:\HrmsAlertSvc\HrmsAlertSvc.exe

    Installing service ExitClosuresAlertSvc...

    Creating EventLog source ExitClosuresAlertSvc in log Application...


    An exception occurred during the Install phase.

    System.Security.SecurityException: Requested registry access is not allowed.


    The Rollback phase of the installation is beginning.

    See the contents of the log file for the D:\HrmsAlertSvc\HrmsAlertSvc.exe assemb

    ly's progress.

    The file is located at D:\HrmsAlertSvc\HrmsAlertSvc.InstallLog.

    Rolling back assembly 'D:\HrmsAlertSvc\HrmsAlertSvc.exe'.

    Affected parameters are:

    logtoconsole =

    i =

    logfile = D:\HrmsAlertSvc\HrmsAlertSvc.InstallLog

    assemblypath = D:\HrmsAlertSvc\HrmsAlertSvc.exe

    Restoring event log to previous state for source ExitClosuresAlertSvc.

    An exception occurred during the Rollback phase of the System.Configuration.Inst

    all.AssemblyInstaller installer.

    System.UnauthorizedAccessException: Access to the path 'D:\HrmsAlertSvc\HrmsAler

    tSvc.InstallState' is denied.

    An exception occurred during the Rollback phase of the installation. This except

    ion will be ignored and the rollback will continue. However, the machine might n

    ot fully revert to its initial state after the rollback is complete.


    The Rollback phase completed successfully.


    The transacted install has completed.

    The installation failed, and the rollback has been performed.

  12. I am trying to get data from other server and i get right response as well as below error


    XMLHttpRequest cannot load http://dex2y.xyrn.com/data/profiledata.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:56711' is therefore not allowed access.




    Request:


    $.ajax({ url: "http://dex2y.xyrn.com/data/profiledata.json", async: false, dataType: "json", success: function (json) { exampleValues = json; } });



    Response:


    {

    "header": "Bob's Profile",

    "name": "Bob Robertson",

    "address": "1010 Some Street, New York, NY, 10001",

    "phone": "(212) 555-1212",

    "interests": "Bob likes apples, big ones and floating ones."

    }



    and i am not able understand about this error.

    post-178898-0-51243300-1456982641_thumb.png

×
×
  • Create New...