Sunday, 26 September 2021

kendo angualar grid

 kendo grid switch case here

new link practice here

just normal lookhere

datatables

 check this link very informative

Restsharp access json key value

    IRestResponse response = client.Execute(request);

            Console.WriteLine(response.Content);

           

            dynamic api = JObject.Parse(response.Content);


to grab the keyvalue from the data using above line code in restsharp


Thursday, 23 September 2021

type script

In typescript we inherited form one class object we cant assign value directly we need to pass entire object list 
for example i have a class with four data properties

 this.csrazureprop={
      crv:"P-256",
      keyType:v.name,
      keysize:256,

    }
if i assign a value get an error like below
this.csrazureprop.crv="p-256".it doesn't work throw an error.
for class object we should write in an object format only

validatiaon angular click

codeing importent click

codeing importent click here
check angular here

var str="hello world" undefined str.includes("world") true var str="www.piltd.com" undefined str.includes("piltd.com") true

Wednesday, 15 September 2021

git conflict issues

 


git merge issues resolved this 

git reset --hard HEAD

git fetch origin 

git reset --hard origin

issue is confilct beween smae page commit so

i forcefully deleted my code and taken from master

using above commnds git conflict 

git profile create


git








js

 https://ourcodesolution.com/blog/drag-drop-game-with-javascript/

jquey


azure

 https://www.freeformatter.com/cron-expression-generator-quartz.html


clone expression generater

Sunday, 12 September 2021

get src by id

for dyanmic images display image on popup 


 function showImage(i) {

  

   

        var img = document.getElementById('img_'+i);

        img.className = 'element';


        var modalImg = document.getElementById("img01");

        var captionText = document.getElementById("caption");


        modal.style.display = "block";

        modalImg.src = img.currentSrc;

        captionText.innerHTML = this.alt;

    }


read this link to know how to access the subnode of each element

for example get src.



asp.net mvc dynamic image click show on popup

  <div class="row">

                    @for (int i = 0; i < Model.productImages.Count(); i++)

                    {

                        if (i == 0)

                        {

                            <div class="column2">

                                <img src="~/Uploads/Product/@Model.productMaster.ProductID/@Model.productImages[i].ImageName" style="width:100%"  class="hover-shadow cursor">

                            </div>

                        }

                        else

                        {

                            <div class="column">

                                <img src="~/Uploads/Product/@Model.productMaster.ProductID/@Model.productImages[i].ImageName" style="width:100%" class="hover-shadow cursor">

                            </div>

                        }

                    }

                </div>


1.the jaery and and javascript code for open image in new window below.

<!-- The Modal -->

<div id="myModal" class="modal">

    <span class="close">&times;</span>

    <img class="modal-content" id="img01">

    <div id="caption"></div>

</div>

<script>

    var modal = document.getElementById("myModal");


    // Get the image and insert it inside the modal - use its "alt" text as a caption

   // var img = document.getElementById("myImg");

    


    // Get the <span> element that closes the modal

    var span = document.getElementsByClassName("close")[0];


    // When the user clicks on <span> (x), close the modal

    span.onclick = function () {

        modal.style.display = "none";

    }

    $(".column2 img").click(function () {

        debugger

        var imgsrc = $('.column2 img').prop('src');

        alert(imgsrc);

        var modalImg = document.getElementById("img01");

        var captionText = document.getElementById("caption");

        

            modal.style.display = "block";

            modalImg.src = imgsrc;

            captionText.innerHTML = this.alt;

        

    });

styles for popup

take from here

 best image preview cick here

mvc chagne default dropdown value

  <div class="col-sm-12">

                        @Html.DropDownListFor(x => x.productMaster.PaymentOption, new SelectList((List<Config.Contract.Lookup>)ViewData["PaymentType"],

                                                                                   "LookupID", "LookupDescription"), "THB", new { @class = "form-control input-sm" })

                    </div>

1.here instead of seleted type i have given value code thb

2.incase you have id instead of value give like this

 <div class="col-sm-6">

                        @Html.DropDownListFor(x => x.productMaster.AgeType, new SelectList((List<Config.Contract.Lookup>)ViewData["AgeType"],

                                                                                    "LookupID", "LookupDescription", 2130), AppResource.Age, new { @class = "form-control input-sm" })

       </div>

Saturday, 11 September 2021

flutter


flutter features click here

most usefull  website

check this

flutter sample app https://www.flutterhub.site/templates/bigbasket-cart-ui/

installed all requied files and c+ tools and andriod goto tools sdk slect cmdline feature also

https://developer.android.com/studio/run/emulator


https://www.jetbrains.com/toolbox-app/










Friday, 10 September 2021

Asp.net Mvc Url extentisons

  public static class UrlHelperExtensions

    {

        //

        // Summary:

        //     Generates a URL with an absolute path for an action method.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        // Returns:

        //     The generated URL.

        public static string Action(this IUrlHelper helper);

       

Thursday, 9 September 2021

css styles

 give sapces between list under ul

ul {
  1. line-height: 50px;

Wednesday, 8 September 2021

git commands

 git commit -a -m "The Commit message"

git add .

commit all pages

git push

Tuesday, 7 September 2021

sql table

 truncate delte table with complete increment id also
delete only remove recordes 


https://www.awesomescreenshot.com/video/5180269?key=aa5bb748d1fe2760bcce0c3c22f177a6

postman data

Saturday, 4 September 2021

typescirpt

 

7 Utility Types that Every TypeScript Developer Should Know



Generics
Whatever benefits we obtain from avoiding repetition in code, we can obtain from creating reusable types as well. Much like creating functions for repetitive logics, generics is a TypeScript feature that allows us to write reusable types.
Let’s look at an example:

type Add<T> = (a: T, b: T) => T

const addNumbers: Add<number> = (a, b) => {
  return a + b
}

const addStrings: Add<string> = (a, b) => {
  return a + b
}

By placing the right type into the generics of Add, it can be used to describe the summation of two numbers or the concatenation of two strings. Instead of writing a type for each function, we only need to do it once with generics. It does not only save us efforts, but also makes our code cleaner and less prone to errors.

Utility Types
TypeScript natively provides several useful utility types to help us with some common type transformations. These utility types are globally available and they all make use of generics.
Here below are 7powerful yet easy to use utility types that every TypeScript developer should know.
1. Pick<Type, Keys>
The Pick utility type creates a new type by picking the set of properties Keys, which can be a string literal or union of string literals, from Type. The value of Keys has to be the keys of Type, otherwise TypeScript compiler will complain. This utility type is especially useful when you want to create lighter objects by picking certain properties from objects with a lot of properties.

type User = {
name: string
age: number
address: string
occupation: string
}
type BasicUser = Pick<User, "name" | "age">
// type BasicUser = {
// name: string;
// age: number;
// }
2. Omit<Type, Keys>
The Omit utility type is the opposite of Pick. Instead of stating what properties to keep, Keys refers to the set of properties keys to be omitted. It is more useful when you only want to get rid of certain properties from an object and keep the others.
type User = {
name: string
age: number
address: string
occupation: string
}
type BasicUser = Omit<User, "address" | "occupation">
// type BasicUser = {
// name: string;
// age: number;
// }
3. Partial<Type>
The Partial utility type constructs a type with all properties of Type set to optional. It can be very useful when we are writing the update logic of an object.
type User = {
name: string
age: number
address: string
occupation: string
}
type PartialUser = Partial<User>
// type PartialUser = {
// name?: string;
// age?: number;
// address?: string;
// occupation?: string;
// }
4. Required<Type>
The Required utility type does the opposite of Partial. It constructs a type with all properties of Type set to required. It can be used to ensure that no optional properties appear in a type.
type PartialUser = {
name: string
age: number
address?: string
occupation?: string
}
type User = Required<PartialUser>
// type User = {
// name: string;
// age: number;
// address: string;
// occupation: string;
// }
5. Readonly<Type>
The Readonly utility type construct a type with all properties of Type set to read only. Reassigning new values to its variable and properties will result in TypeScript warning.
type User = {
name: string
age: number
address: string
occupation: string
}
type ReadOnlyUser = Readonly<User>
const user: ReadOnlyUser = {
name: "Peter",
age: 24,
address: "Toronto",
occupation: "software_engineer"
}
user.name = "Tom"
// Cannot assign to 'name' because it is a read-only property.
6. Record<Keys, Type>
The Record utility type constructs an object type with property keys from Keys and value of type Type.

type User = {
name: string
age: number
address: string
occupation: string
}
type Team = Record<"player1" | "player2", User>
// type Team = {
// player1: User;
// player2: User;
// }
7. ReturnType<Type>
The ReturnType utility type constructs a type from the return type of a function type. It is useful when we are handling function types from external libraries and want to build custom types based on them.
import axios from 'axios'
type Response = ReturnType<typeof axios>
function callAPI(): Response{
return axios("url")
}
Apart from the abovementioned, there are also other utility types that can help TypeScript developers write cleaner and “DRY-er” types. The link to the TypeScript documentation on Utility Types can be found here.

7 Common mistakes in Dot Net — You can avoid

  There are many common mistakes made during .NET (ASP.NET, .NET Core) development, which affect performance, security, and code… Code Crack...