C# ASPXGRIDVIEW GET TOTAL SUMMARY

protected void Buttonhepsiniode_Click(object sender, EventArgs e)
{

    //for (int i = 0; i < ASPxGridView2.VisibleRowCount; i++)
    //{
    //    var items = ASPxGridView2.GetRowValues(i, new string[] { "FISNO", "TL_BORC" }) as object[];
    //    // ASPxListBox1.Items.Add(rowValues[0].ToString());
    //    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CarringtonWebConnectionString1"].ConnectionString);
    //    con.Open();
    //    SqlCommand cmd = new SqlCommand("update ACIKHESAP set ODEME_DURUMU=2, ODENEN_TUTAR=" + items[1].ToString() + " where ID=" + items[0].ToString(), con);
    //    cmd.ExecuteNonQuery();
    //    Labeltesekkurler.Visible = true;
    //}
    Decimal SMTUTAR = Convert.ToDecimal(ASPxGridView2.GetTotalSummaryValue(ASPxGridView2.TotalSummary["TL_BORC"]));
    Global.TUTAR = null;
    Global.TUTAR = SMTUTAR.ToString();
    Server.Transfer("payment.aspx");
}

C# DEVEXPRESS ASPXGRIDVIEW SELECTED ROWS TOTAL

protected void Button1_Click(object sender, EventArgs e)
{
    //List SelectedDebts = grid.GetSelectedFieldValues(new string[] { "FISNO", "TL_BORC" });
    //foreach (object debts in SelectedDebts)
    //{
    //    IList items = debts as IList;
    //    if (items == null) return;
    //    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CarringtonWebConnectionString1"].ConnectionString);
    //    con.Open();
    //    SqlCommand cmd = new SqlCommand("update ACIKHESAP set ODEME_DURUMU=1, ODENEN_TUTAR=" + items[1].ToString() + " where ID=" + items[0].ToString(), con);
    //    cmd.ExecuteNonQuery();
    //    Labeltesekkurler.Visible = true;
    //}


    //List SelectedDebts = grid.GetSelectedFieldValues(new string[] { "FISNO", "TL_BORC" });
    Decimal selectedTUTAR = 0;
    foreach (object value in ASPxGridView2.GetSelectedFieldValues("TL_BORC"))
    {
        {
            selectedTUTAR += Convert.ToDecimal(value);
        }

    }

    Global.TUTAR = null;
    Global.TUTAR = selectedTUTAR.ToString();
    Server.Transfer("payment.aspx");

}

c# devexpress windows form skin

new c# windows form NOT DEVEXPRESS

 

add reference devexpress.bonusskins
devexpres.utils
devexpress.utils ui

DELETE FORM1 AND ADD DEVEXPRESS ITEM FORM

PROGRAM.CS :

 

            DevExpress.UserSkins.BonusSkins.Register();
            DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("McSkin");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());

visual c# encrypt decrypt text file

First create class : encrypt_decrypt.cs
inside:

using System;
using System.Security.Cryptography;
using System.Text;

namespace RestWebinarSample
{

    class Encryptor
    {
        public static string IV = "1a1a1a1a1a1a1a1a";
        public static string Key = "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a13";

        public static string Encrypt(string decrypted)
        {
            byte[] textbytes = ASCIIEncoding.ASCII.GetBytes(decrypted);
            AesCryptoServiceProvider endec = new AesCryptoServiceProvider();
            endec.BlockSize = 128;
            endec.KeySize = 256;
            endec.IV = ASCIIEncoding.ASCII.GetBytes(IV);
            endec.Key = ASCIIEncoding.ASCII.GetBytes(Key);
            endec.Padding = PaddingMode.PKCS7;
            endec.Mode = CipherMode.CBC;
            ICryptoTransform icrypt = endec.CreateEncryptor(endec.Key, endec.IV);
            byte[] enc = icrypt.TransformFinalBlock(textbytes, 0, textbytes.Length);
            icrypt.Dispose();
            return Convert.ToBase64String(enc);
        }

        public static string Decrypted(string encrypted)
        {
            byte[] textbytes = Convert.FromBase64String(encrypted);
            AesCryptoServiceProvider endec = new AesCryptoServiceProvider();
            endec.BlockSize = 128;
            endec.KeySize = 256;
            endec.IV = ASCIIEncoding.ASCII.GetBytes(IV);
            endec.Key = ASCIIEncoding.ASCII.GetBytes(Key);
            endec.Padding = PaddingMode.PKCS7;
            endec.Mode = CipherMode.CBC;
            ICryptoTransform icrypt = endec.CreateDecryptor(endec.Key, endec.IV);
            byte[] enc = icrypt.TransformFinalBlock(textbytes, 0, textbytes.Length);
            icrypt.Dispose();
            return System.Text.ASCIIEncoding.ASCII.GetString(enc);
        }
    }
}

then 2 buttons encrypt and decrypt

private void encrypt_Click(object sender, EventArgs e)
{

    Directory.CreateDirectory("data\\");

    var sw = new StreamWriter("data\\" + "data.ls");

    string enctxt = Encryptor.Encrypt("willbeencrypted");

    sw.WriteLine(enctxt);

    sw.Close();
}

private void decrypt_Click(object sender, EventArgs e)
{
    StreamReader sr = new StreamReader(Application.StartupPath + "\\data\\" + "data.ls");
    string line = sr.ReadLine();

    MessageBox.Show(Encryptor.Decrypted(Convert.ToString(line)));
}

ASPXGRIDVIEW İşlemleri

Gridviewde seçili satırın bilgisini alabilme :
        protected void ASPxGridView1_SelectionChanged(object sender, EventArgs e)
        {
            var products = ASPxGridView1.GetSelectedFieldValues(“NAME”);
            Label1.Text = products[0].ToString();
        }

Gridviewin Sonuna İşlemler Seç eklemek için source da sona ekle
           
               
           
       
   

Gridview devexpress 7.2 sonrası için gecerli export Gridview
un altina ekle
 

un ustune ekle
        <Toolbars>
            <dx:GridViewToolbar EnableAdaptivity=“true”>
                <Items>
                    <dx:GridViewToolbarItem Command=“ExportToPdf” />
                    <dx:GridViewToolbarItem Command=“ExportToXls” />
                    <dx:GridViewToolbarItem Command=“ExportToXlsx” />
                    <dx:GridViewToolbarItem Command=“ExportToDocx” />
                    <dx:GridViewToolbarItem Command=“ExportToRtf” />
                    <dx:GridViewToolbarItem Command=“ExportToCsv” />
                </Items>
            </dx:GridViewToolbar>
        </Toolbars>


Gridview grup category combobox ve baglantisi 
birinci sqldatasource_musteriler yarat ve bunu aspxgridviewe bind
Ikinci datasource sqldatasource_musterigruplari  yarat  bu bir yere bind olmayacak

Sqlden iki tablo yarat birinin adi musteri(id,adi,grupid) olsun
digeride musteri_grup (id,grup_adi) olsun

aspxgridview designerda columnsa tikla combobox column ekle captionunu grup yap, Fieldname grupid sec, sag tabda comboboxpropertiesde datasourceid musteri_gruplarini sec text field grup_adi , valuefield=id 


Gridview Horizontal scrollbar 

   

       

       

       

Datasource eklemede hata alırsan sol taraftan server explorerden modify deyip save passwordu seç


Gridview  Required zorunlu alan ayari
Designerda ac ve columnsdan zorunlu alana tıkla ve sağda textboxpropertiesden en aşağıda validation settingste requiredi true yap

Master Detail Grid
ONCE 2 TANE SQLDATASOURCE VE 2 TANE ASPXGRIDVIEW YARAT BIRI MUSTERILER DIGERI MUSTERI HAREKETLER
MUSTERILERI NORMAL TABLODAN AL ASPXGRIDVIEW MUSTERILERIN SETTINGS DETAILDE DETAILROWU TRUE YAP,

MUSTERI HAREKETLERINIDE AL WHERE KISMINA TIKLA COLUMN MUSTERI_ID OPERATOR ” = ”  , SOURCE SESSION , SESSION FIELD = MUSTERI_ID

VE DAHA SONRA KODA EKLE
        protected void ASPxGridViewmusterihareketler_BeforePerformDataSelect(object sender, EventArgs e)
        {
            Session[“MUSTERI_ID”] = (sender as ASPxGridView).GetMasterRowKeyValue();
        }

SON OLARAKDA ASPXGRIDVIEWMUSTERILERE TIKLA EDITTEMPLATE VE DETAILROWU SEC VE ASPXGRIDMUSTERIHAREKETLERINI ICINE SURUKLE VE END TEMPLATE YAP


Gridviewda son kolumun genişliğini max yapmak
       
           
           
           
               
           
            <dx:GridViewDataTextColumn FieldName="ADI" VisibleIndex="2" Width=”100%”>
           
       


gridview detay masterda detay width sorunu once masterin altina ekle :
    <dx:ASPxGridView Width=”100%” 
       
       

sonra masterin son colomunun widthini %100 yap
 

sonra detaya ekle
   <dx:ASPxGridView2 Width=”100%” 
       
       

Visual studio Projeni lisanslama olaylari

Özetle CryptoLicesnsi kur ve crackle sonra aç programı visual studioda proje yeni de refereransa cyrptolicensin kurulduğu klasörden LogicNP.CryptoLicensing.dll ekle. Ve cryptolicense programına geri geç project get validationdan kodunu al.
Google Drive\visual studio\cryptolisans\CryptoLicensingNet2015Enterprise.rar
Aşağıda serili ama tam calısmıyor
            string licOrSerial = “3SNK-JR68-VWR4-CU3U-DK5T-6M4Y-TGNU-W99Z”; // may be entered by user
            CryptoLicense lic = new CryptoLicense(“AMAAMACcdnLRtdM/BVep5vzxoSJkHW04yTbB6RBlL3AebAgDpcaAJ5m3ygqP8ueGL1ZQA1EDAAEAAQ==”);
            lic.LicenseServiceURL = “<>”;
            // Try to validate serial and retrieve license against the serial
            SerialValidationResult result = lic.GetLicenseFromSerial(licOrSerial);
            if(result == SerialValidationResult.Failed)
            {
                // ‘licOrSerial’ is in serial form but validation of serial failed
                MessageBox.Show(“Serial Validation Failed”);
                return;
            }
            elseif (result == SerialValidationResult.NotASerial)
            {
                // ‘licOrSerial’ is not a serial but may be a license, set lic.LicenseCode and validate it
                lic.LicenseCode = licOrSerial;
            }
            else//if (result == SerialValidationResult.Success)
            {
                // CryptoLicense.GetLicenseFromSerial set the lic.LicenseCode with the retrieved license code
                // validate it
            }
            // Validate license by querying Status property
            if(lic.Status != LicenseStatus.Valid)
            {
                MessageBox.Show(“License Validation Failed”);
                return;
            }
To start using CryptoLicensing for the licensing and copy-protection of your software, follow these simple steps:
In CryptoLicensing Generator:
  1. Start the CryptoLicensing Generator application from the Start Menu.
  2. Create a new license project : File menu –> Create New Project –> accept default settings by clicking OK button.
  3. Save the license project : File menu –> Save Project.
  4. Get the validation code for your project : Project menu –> Get Validation Key And Code.
  5. Generate a simple license code without any settings : simply click the Generate button. A new license code will be generated and displayed in the bottom textbox.
In Your Software Source Code Project:
  • Reference the LogicNP.CryptoLicensing.dll file from your project. This is the CryptoLicensing validation module. Note: For Silverlight, Windows Phone 7, or other kinds of projects, see Deploying Your Software for the exact assembly to reference.
  • At the top of your code file, add the following namespace declarations:
  using LogicNP.CryptoLicensing;
  • Write simple license validation code as follows:
    
            CryptoLicense lic = new CryptoLicense();
            lic.ValidationKey = “validation key obtained in step #4 above”;
            lic.LicenseCode = “license code generated in step #5 above”;
            // Validate the license using .Status property
            if (lic.Status != LicenseStatus.Valid)
                throw new Exception(“license validation failed”);

That’s it! Its that simple to start using CryptoLicensing for the licensing of your software.


Further Code Samples
The above code is a very simplistic code. Typically, you will not hard-code a license code in your software in the above manner, but load it as follows:
                      
                      
            // Load license from the registry
            lic.StorageMode = LicenseStorageMode.ToRegistry;
            if (lic.Load() == false)
                throw new Exception(“License could not be loaded”);
            // Validate the license using .Status property
            if (lic.Status != LicenseStatus.Valid)
                throw new Exception(“license validation failed”);

For the load method to succeed, there should be a previously saved license code in the first place. The license code is saved by calling the CryptoLicense.Save method in another part of your software which prompts the user for the license code. If you use the CryptoLicense.ShowEvaluationInfoDialog method to prompt the user for the license code, the dialog will automatically call the Save method for you.
If you are validating licenses requiring communication with the license service, make sure you specify the license service URL before validating the license code as follows:
                      
                      
            lic.LicenseServiceURL = “http://www.mysite.com/LicenseService/Service.asmx&#8221;
            // Validate the license using .Status property
            if (lic.Status != LicenseStatus.Valid)
                throw new Exception(“license validation failed”);

Further code samples demonstrating a variety of common licensing scenarios can be found in the Samples folder under the installation folder.