Example #1
0
        public CurrHistory()
        {
            bllCurrency = App.bllCurrency;
            BPS.BLL.Currency.DataSets.dsCurrHistory dsH = bllCurrency.DataSetHistory;
            BPS.BLL.Currency.DataSets.dsCurr        dsC = bllCurrency.DataSet;

            InitializeComponent();

            this.dtCurr = new DataTable("CurrHistory");
            DataColumn currID = new DataColumn("Currency");

            this.dtCurr.Columns.Add(currID);
            for (int i = 0; i < dsC.Currencies.Rows.Count; i++)
            {
                DataColumn dc = new DataColumn(dsC.Currencies.Rows[i]["CurrencyID"].ToString());
                dc.DataType = System.Type.GetType("System.Double");
                this.dtCurr.Columns.Add(dc);
            }
            dataGridTableStyle1 = new DataGridTableStyle();
            this.dataGridTableStyle1.MappingName = "CurrHistory";
            this.dataView1.Table       = this.dtCurr;      //dsH.CurrenciesHistory;
            this.dataGridV1.DataSource = this.dataView1;   //this.dtCurr;
            this.setDgStyle();
            this.dataGridV1.TableStyles.Add(this.dataGridTableStyle1);
            this.dvHistory.Table   = dsH.CurrenciesHistory;
            this.checkBox1.Checked = true;

            App.SetDataGridTableStyle(this.dataGridTableStyle1);
        }
Example #2
0
 public CurrList()
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     App.SetDataGridTableStyle(this.dataGridTableStyle1);
     bllCurrency          = App.bllCurrency;
     this.dsCurr1         = bllCurrency.DataSet;
     this.dataView1.Table = this.dsCurr1.Currencies;
 }
Example #3
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.sqlConnection1        = new System.Data.SqlClient.SqlConnection();
     this.sqldaClients          = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand2     = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand2     = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1     = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand2     = new System.Data.SqlClient.SqlCommand();
     this.dsClients1            = new BPS.BLL.Clients.DataSets.dsClients();
     this.sqlDataAdapter2       = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand1     = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand1     = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand2     = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1     = new System.Data.SqlClient.SqlCommand();
     this.dsGroups1             = new BPS.BLL.Clients.DataSets.dsGroups();
     this.dsCurr1               = new BPS.BLL.Currency.DataSets.dsCurr();
     this.sqldaSelOrgsClients   = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlCommand2           = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectClientsOrgs  = new System.Data.SqlClient.SqlCommand();
     this.sqlCommand1           = new System.Data.SqlClient.SqlCommand();
     this.dsOrgsClients1        = new BPS.BLL.Clients.DataSets.dsOrgsClients();
     this.sqldaGetAvailableOrgs = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlCommand3           = new System.Data.SqlClient.SqlCommand();
     this.sqlCommand4           = new System.Data.SqlClient.SqlCommand();
     this.sqlCommand5           = new System.Data.SqlClient.SqlCommand();
     ((System.ComponentModel.ISupportInitialize)(this.dsClients1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsGroups1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsCurr1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsOrgsClients1)).BeginInit();
     //
     // sqlConnection1
     //
     this.sqlConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("ConnectionString", typeof(string))));
     //
     // sqldaClients
     //
     this.sqldaClients.DeleteCommand = this.sqlDeleteCommand2;
     this.sqldaClients.InsertCommand = this.sqlInsertCommand2;
     this.sqldaClients.SelectCommand = this.sqlSelectCommand1;
     this.sqldaClients.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Clients", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ClientID", "ClientID"),
             new System.Data.Common.DataColumnMapping("ClientGroupID", "ClientGroupID"),
             new System.Data.Common.DataColumnMapping("ClientName", "ClientName"),
             new System.Data.Common.DataColumnMapping("ClientRemarks", "ClientRemarks"),
             new System.Data.Common.DataColumnMapping("IsInner", "IsInner"),
             new System.Data.Common.DataColumnMapping("IsSpecial", "IsSpecial"),
             new System.Data.Common.DataColumnMapping("Password", "Password")
         })
     });
     this.sqldaClients.UpdateCommand = this.sqlUpdateCommand2;
     //
     // sqlDeleteCommand2
     //
     this.sqlDeleteCommand2.CommandText = "[ClientDelete]";
     this.sqlDeleteCommand2.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlDeleteCommand2.Connection  = this.sqlConnection1;
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(10)), ((System.Byte)(0)), "ClientID", System.Data.DataRowVersion.Current, null));
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(10)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     //
     // sqlInsertCommand2
     //
     this.sqlInsertCommand2.CommandText = @"INSERT INTO Clients (ClientGroupID, ClientName, ClientRemarks, IsInner, IsSpecial, Password) VALUES (@ClientGroupID, @ClientName, @ClientRemarks, @IsInner, @IsSpecial, @Password); SELECT Clients.ClientID, Clients.ClientGroupID, Clients.ClientName, Clients.ClientRemarks, ClientsGroups.ClientGroupName, Clients.IsInner, Clients.IsSpecial, Clients.Password FROM Clients INNER JOIN ClientsGroups ON Clients.ClientGroupID = ClientsGroups.ClientGroupID WHERE (Clients.ClientID = @@IDENTITY)";
     this.sqlInsertCommand2.Connection  = this.sqlConnection1;
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientGroupID", System.Data.SqlDbType.Int, 4, "ClientGroupID"));
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientName", System.Data.SqlDbType.NVarChar, 50, "ClientName"));
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientRemarks", System.Data.SqlDbType.NVarChar, 255, "ClientRemarks"));
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsInner", System.Data.SqlDbType.Bit, 1, "IsInner"));
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsSpecial", System.Data.SqlDbType.Bit, 1, "IsSpecial"));
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Password", System.Data.SqlDbType.NVarChar, 48, "Password"));
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = @"SELECT Clients.ClientID, Clients.ClientGroupID, Clients.ClientName, Clients.ClientRemarks, Clients.IsInner, Clients.IsSpecial, Clients.Password, ClientsGroups.ClientGroupName FROM Clients INNER JOIN ClientsGroups ON Clients.ClientGroupID = ClientsGroups.ClientGroupID ORDER BY Clients.ClientName";
     this.sqlSelectCommand1.Connection  = this.sqlConnection1;
     //
     // sqlUpdateCommand2
     //
     this.sqlUpdateCommand2.CommandText = @"UPDATE Clients SET ClientGroupID = @ClientGroupID, ClientName = @ClientName, ClientRemarks = @ClientRemarks, IsInner = @IsInner, IsSpecial = @IsSpecial, Password = @Password WHERE (ClientID = @Original_ClientID) AND (ClientGroupID = @Original_ClientGroupID) AND (ClientName = @Original_ClientName) AND (ClientRemarks = @Original_ClientRemarks) AND (IsInner = @Original_IsInner) AND (IsSpecial = @Original_IsSpecial OR @Original_IsSpecial IS NULL AND IsSpecial IS NULL) AND (Password = @Original_Password OR @Original_Password IS NULL AND Password IS NULL); SELECT ClientID, ClientGroupID, ClientName, ClientRemarks, IsInner, IsSpecial, Password FROM Clients WHERE (ClientID = @ClientID)";
     this.sqlUpdateCommand2.Connection  = this.sqlConnection1;
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientGroupID", System.Data.SqlDbType.Int, 4, "ClientGroupID"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientName", System.Data.SqlDbType.NVarChar, 50, "ClientName"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientRemarks", System.Data.SqlDbType.NVarChar, 255, "ClientRemarks"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsInner", System.Data.SqlDbType.Bit, 1, "IsInner"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsSpecial", System.Data.SqlDbType.Bit, 1, "IsSpecial"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Password", System.Data.SqlDbType.NVarChar, 128, "Password"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientGroupID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientGroupID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientName", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientName", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientRemarks", System.Data.SqlDbType.NVarChar, 255, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientRemarks", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_IsInner", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "IsInner", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_IsSpecial", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "IsSpecial", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Password", System.Data.SqlDbType.NVarChar, 128, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Password", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientID", System.Data.SqlDbType.Int, 4, "ClientID"));
     //
     // dsClients1
     //
     this.dsClients1.DataSetName = "dsClients";
     this.dsClients1.Locale      = new System.Globalization.CultureInfo("ru-RU");
     //
     // sqlDataAdapter2
     //
     this.sqlDataAdapter2.DeleteCommand = this.sqlDeleteCommand1;
     this.sqlDataAdapter2.InsertCommand = this.sqlInsertCommand1;
     this.sqlDataAdapter2.SelectCommand = this.sqlSelectCommand2;
     this.sqlDataAdapter2.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "ClientsGroups", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ClientGroupID", "ClientGroupID"),
             new System.Data.Common.DataColumnMapping("ClientGroupName", "ClientGroupName"),
             new System.Data.Common.DataColumnMapping("ClientGroupRemarks", "ClientGroupRemarks"),
             new System.Data.Common.DataColumnMapping("IsInner", "IsInner"),
             new System.Data.Common.DataColumnMapping("IsSpecial", "IsSpecial")
         })
     });
     this.sqlDataAdapter2.UpdateCommand = this.sqlUpdateCommand1;
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = "DELETE FROM ClientsGroups WHERE (ClientGroupID = @Original_ClientGroupID) AND (Cl" +
                                          "ientGroupName = @Original_ClientGroupName) AND (ClientGroupRemarks = @Original_C" +
                                          "lientGroupRemarks) AND (IsInner = @Original_IsInner) AND (IsSpecial = @Original_" +
                                          "IsSpecial)";
     this.sqlDeleteCommand1.Connection = this.sqlConnection1;
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientGroupID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientGroupID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientGroupName", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientGroupName", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientGroupRemarks", System.Data.SqlDbType.NVarChar, 512, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientGroupRemarks", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_IsInner", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "IsInner", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_IsSpecial", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "IsSpecial", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = @"INSERT INTO ClientsGroups(ClientGroupName, ClientGroupRemarks, IsInner, IsSpecial) VALUES (@ClientGroupName, @ClientGroupRemarks, @IsInner, @IsSpecial); SELECT ClientGroupID, ClientGroupName, ClientGroupRemarks, IsInner, IsSpecial FROM ClientsGroups WHERE (ClientGroupID = @@IDENTITY)";
     this.sqlInsertCommand1.Connection  = this.sqlConnection1;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientGroupName", System.Data.SqlDbType.NVarChar, 50, "ClientGroupName"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientGroupRemarks", System.Data.SqlDbType.NVarChar, 512, "ClientGroupRemarks"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsInner", System.Data.SqlDbType.Bit, 1, "IsInner"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsSpecial", System.Data.SqlDbType.Bit, 1, "IsSpecial"));
     //
     // sqlSelectCommand2
     //
     this.sqlSelectCommand2.CommandText = "SELECT ClientGroupID, ClientGroupName, ClientGroupRemarks, IsInner, IsSpecial FRO" +
                                          "M ClientsGroups ORDER BY ClientGroupName";
     this.sqlSelectCommand2.Connection = this.sqlConnection1;
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = @"UPDATE ClientsGroups SET ClientGroupName = @ClientGroupName, ClientGroupRemarks = @ClientGroupRemarks, IsInner = @IsInner, IsSpecial = @IsSpecial WHERE (ClientGroupID = @Original_ClientGroupID) AND (ClientGroupName = @Original_ClientGroupName) AND (ClientGroupRemarks = @Original_ClientGroupRemarks) AND (IsInner = @Original_IsInner) AND (IsSpecial = @Original_IsSpecial); SELECT ClientGroupID, ClientGroupName, ClientGroupRemarks, IsInner, IsSpecial FROM ClientsGroups WHERE (ClientGroupID = @ClientGroupID)";
     this.sqlUpdateCommand1.Connection  = this.sqlConnection1;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientGroupName", System.Data.SqlDbType.NVarChar, 50, "ClientGroupName"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientGroupRemarks", System.Data.SqlDbType.NVarChar, 512, "ClientGroupRemarks"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsInner", System.Data.SqlDbType.Bit, 1, "IsInner"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsSpecial", System.Data.SqlDbType.Bit, 1, "IsSpecial"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientGroupID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientGroupID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientGroupName", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientGroupName", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientGroupRemarks", System.Data.SqlDbType.NVarChar, 512, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientGroupRemarks", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_IsInner", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "IsInner", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_IsSpecial", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "IsSpecial", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientGroupID", System.Data.SqlDbType.Int, 4, "ClientGroupID"));
     //
     // dsGroups1
     //
     this.dsGroups1.DataSetName = "dsGroups";
     this.dsGroups1.Locale      = new System.Globalization.CultureInfo("ru-RU");
     //
     // dsCurr1
     //
     this.dsCurr1.DataSetName = "dsCurr";
     this.dsCurr1.Locale      = new System.Globalization.CultureInfo("ru-RU");
     //
     // sqldaSelOrgsClients
     //
     this.sqldaSelOrgsClients.InsertCommand = this.sqlCommand2;
     this.sqldaSelOrgsClients.SelectCommand = this.sqlSelectClientsOrgs;
     this.sqldaSelOrgsClients.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "OrgsClients", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ClientID", "ClientID"),
             new System.Data.Common.DataColumnMapping("OrgID", "OrgID"),
             new System.Data.Common.DataColumnMapping("Direction", "Direction"),
             new System.Data.Common.DataColumnMapping("IsAvailable", "IsAvailable"),
             new System.Data.Common.DataColumnMapping("OrgName", "OrgName"),
             new System.Data.Common.DataColumnMapping("CodeINN", "CodeINN"),
             new System.Data.Common.DataColumnMapping("IsRemoved", "IsRemoved")
         })
     });
     this.sqldaSelOrgsClients.UpdateCommand = this.sqlCommand1;
     //
     // sqlCommand2
     //
     this.sqlCommand2.CommandText = "INSERT INTO OrgsClients (ClientID, OrgID, Direction, IsAvailable) VALUES (@Client" +
                                    "ID, @OrgID, @Direction, @IsAvailable)";
     this.sqlCommand2.Connection = this.sqlConnection1;
     this.sqlCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientID", System.Data.SqlDbType.Int, 4, "ClientID"));
     this.sqlCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@OrgID", System.Data.SqlDbType.Int, 4, "OrgID"));
     this.sqlCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Direction", System.Data.SqlDbType.TinyInt, 1, "Direction"));
     this.sqlCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsAvailable", System.Data.SqlDbType.Bit, 1, "IsAvailable"));
     //
     // sqlSelectClientsOrgs
     //
     this.sqlSelectClientsOrgs.CommandText = @"SELECT OrgsClients.ClientID, OrgsClients.OrgID, OrgsClients.Direction, OrgsClients.IsAvailable, Orgs.OrgName, Orgs.CodeINN, Orgs.IsRemoved FROM OrgsClients INNER JOIN Orgs ON OrgsClients.OrgID = Orgs.OrgID WHERE (OrgsClients.ClientID = @ClientID) AND (Orgs.IsRemoved = 0)";
     this.sqlSelectClientsOrgs.Connection  = this.sqlConnection1;
     this.sqlSelectClientsOrgs.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientID", System.Data.SqlDbType.Int, 4, "ClientID"));
     //
     // sqlCommand1
     //
     this.sqlCommand1.CommandText = "UPDATE OrgsClients SET IsAvailable = @IsAvailable WHERE (ClientID = @Original_Cli" +
                                    "entID) AND (Direction = @Original_Direction) AND (OrgID = @Original_OrgID)";
     this.sqlCommand1.Connection = this.sqlConnection1;
     this.sqlCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsAvailable", System.Data.SqlDbType.Bit, 1, "IsAvailable"));
     this.sqlCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientID", System.Data.DataRowVersion.Original, null));
     this.sqlCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Direction", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Direction", System.Data.DataRowVersion.Original, null));
     this.sqlCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_OrgID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "OrgID", System.Data.DataRowVersion.Original, null));
     //
     // dsOrgsClients1
     //
     this.dsOrgsClients1.DataSetName = "dsOrgsClients";
     this.dsOrgsClients1.Locale      = new System.Globalization.CultureInfo("ru-RU");
     //
     // sqldaGetAvailableOrgs
     //
     this.sqldaGetAvailableOrgs.InsertCommand = this.sqlCommand3;
     this.sqldaGetAvailableOrgs.SelectCommand = this.sqlCommand4;
     this.sqldaGetAvailableOrgs.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "OrgsClients", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ClientID", "ClientID"),
             new System.Data.Common.DataColumnMapping("OrgID", "OrgID"),
             new System.Data.Common.DataColumnMapping("Direction", "Direction"),
             new System.Data.Common.DataColumnMapping("IsAvailable", "IsAvailable"),
             new System.Data.Common.DataColumnMapping("OrgName", "OrgName"),
             new System.Data.Common.DataColumnMapping("CodeINN", "CodeINN"),
             new System.Data.Common.DataColumnMapping("IsRemoved", "IsRemoved"),
             new System.Data.Common.DataColumnMapping("CodeKPP", "CodeKPP")
         })
     });
     this.sqldaGetAvailableOrgs.UpdateCommand = this.sqlCommand5;
     //
     // sqlCommand3
     //
     this.sqlCommand3.CommandText = "INSERT INTO OrgsClients (ClientID, OrgID, Direction, IsAvailable) VALUES (@Client" +
                                    "ID, @OrgID, @Direction, @IsAvailable)";
     this.sqlCommand3.Connection = this.sqlConnection1;
     this.sqlCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientID", System.Data.SqlDbType.Int, 4, "ClientID"));
     this.sqlCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@OrgID", System.Data.SqlDbType.Int, 4, "OrgID"));
     this.sqlCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Direction", System.Data.SqlDbType.TinyInt, 1, "Direction"));
     this.sqlCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsAvailable", System.Data.SqlDbType.Bit, 1, "IsAvailable"));
     //
     // sqlCommand4
     //
     this.sqlCommand4.CommandText = @"SELECT OrgsClients.ClientID, OrgsClients.OrgID, OrgsClients.Direction, OrgsClients.IsAvailable, Orgs.OrgName, Orgs.CodeINN, Orgs.IsRemoved, Orgs.CodeKPP FROM OrgsClients INNER JOIN Orgs ON OrgsClients.OrgID = Orgs.OrgID WHERE (OrgsClients.ClientID = @ClientID) AND (Orgs.IsRemoved = 0) AND (OrgsClients.IsAvailable = 1) ORDER BY Orgs.OrgName";
     this.sqlCommand4.Connection  = this.sqlConnection1;
     this.sqlCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientID", System.Data.SqlDbType.Int, 4, "ClientID"));
     //
     // sqlCommand5
     //
     this.sqlCommand5.CommandText = "UPDATE OrgsClients SET IsAvailable = @IsAvailable WHERE (ClientID = @Original_Cli" +
                                    "entID) AND (Direction = @Original_Direction) AND (OrgID = @Original_OrgID)";
     this.sqlCommand5.Connection = this.sqlConnection1;
     this.sqlCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsAvailable", System.Data.SqlDbType.Bit, 1, "IsAvailable"));
     this.sqlCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ClientID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ClientID", System.Data.DataRowVersion.Original, null));
     this.sqlCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Direction", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Direction", System.Data.DataRowVersion.Original, null));
     this.sqlCommand5.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_OrgID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "OrgID", System.Data.DataRowVersion.Original, null));
     ((System.ComponentModel.ISupportInitialize)(this.dsClients1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsGroups1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsCurr1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsOrgsClients1)).EndInit();
 }
Example #4
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CurrList));
     this.dataGrid1              = new AM_Controls.DataGridV();
     this.contextMenu1           = new System.Windows.Forms.ContextMenu();
     this.dataView1              = new System.Data.DataView();
     this.dsCurr1                = new BPS.BLL.Currency.DataSets.dsCurr();
     this.dataGridTableStyle1    = new System.Windows.Forms.DataGridTableStyle();
     this.dataGridTextBoxColumn1 = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dataGridTextBoxColumn2 = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dataGridTextBoxColumn3 = new System.Windows.Forms.DataGridTextBoxColumn();
     this.toolBar1               = new System.Windows.Forms.ToolBar();
     this.toolBarButton1         = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton2         = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton4         = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton3         = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton5         = new System.Windows.Forms.ToolBarButton();
     this.tbbRate                = new System.Windows.Forms.ToolBarButton();
     this.imageList1             = new System.Windows.Forms.ImageList(this.components);
     this.mainMenu1              = new System.Windows.Forms.MainMenu();
     this.mnuEdit                = new System.Windows.Forms.MenuItem();
     this.menuItem2              = new System.Windows.Forms.MenuItem();
     this.menuItem3              = new System.Windows.Forms.MenuItem();
     this.menuItem4              = new System.Windows.Forms.MenuItem();
     this.menuItem5              = new System.Windows.Forms.MenuItem();
     this.menuItem6              = new System.Windows.Forms.MenuItem();
     this.menuItem1              = new System.Windows.Forms.MenuItem();
     this.mnuSetCurrencyRate     = new System.Windows.Forms.MenuItem();
     ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dataView1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsCurr1)).BeginInit();
     this.SuspendLayout();
     //
     // dataGrid1
     //
     this.dataGrid1._CanEdit         = false;
     this.dataGrid1._InvisibleColumn = 0;
     this.dataGrid1.CaptionVisible   = false;
     this.dataGrid1.ContextMenu      = this.contextMenu1;
     this.dataGrid1.DataMember       = "";
     this.dataGrid1.DataSource       = this.dataView1;
     this.dataGrid1.Dock             = System.Windows.Forms.DockStyle.Fill;
     this.dataGrid1.HeaderForeColor  = System.Drawing.SystemColors.ControlText;
     this.dataGrid1.Location         = new System.Drawing.Point(0, 72);
     this.dataGrid1.Name             = "dataGrid1";
     this.dataGrid1.ReadOnly         = true;
     this.dataGrid1.Size             = new System.Drawing.Size(340, 175);
     this.dataGrid1.TabIndex         = 1;
     this.dataGrid1.TableStyles.AddRange(new System.Windows.Forms.DataGridTableStyle[] {
         this.dataGridTableStyle1
     });
     this.dataGrid1.DoubleClick += new System.EventHandler(this.dataGrid1_DoubleClick);
     //
     // dataView1
     //
     this.dataView1.Table = this.dsCurr1.Currencies;
     //
     // dsCurr1
     //
     this.dsCurr1.DataSetName = "dsCurr";
     this.dsCurr1.Locale      = new System.Globalization.CultureInfo("ru-RU");
     //
     // dataGridTableStyle1
     //
     this.dataGridTableStyle1.DataGrid = this.dataGrid1;
     this.dataGridTableStyle1.GridColumnStyles.AddRange(new System.Windows.Forms.DataGridColumnStyle[] {
         this.dataGridTextBoxColumn1,
         this.dataGridTextBoxColumn2,
         this.dataGridTextBoxColumn3
     });
     this.dataGridTableStyle1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
     this.dataGridTableStyle1.MappingName     = "Currencies";
     //
     // dataGridTextBoxColumn1
     //
     this.dataGridTextBoxColumn1.Format      = "";
     this.dataGridTextBoxColumn1.FormatInfo  = null;
     this.dataGridTextBoxColumn1.HeaderText  = "Код";
     this.dataGridTextBoxColumn1.MappingName = "CurrencyID";
     this.dataGridTextBoxColumn1.NullText    = "?";
     this.dataGridTextBoxColumn1.Width       = 50;
     //
     // dataGridTextBoxColumn2
     //
     this.dataGridTextBoxColumn2.Format      = "";
     this.dataGridTextBoxColumn2.FormatInfo  = null;
     this.dataGridTextBoxColumn2.HeaderText  = "Название";
     this.dataGridTextBoxColumn2.MappingName = "CurrencyName";
     this.dataGridTextBoxColumn2.NullText    = "";
     this.dataGridTextBoxColumn2.Width       = 150;
     //
     // dataGridTextBoxColumn3
     //
     this.dataGridTextBoxColumn3.Format      = "#,##0.00";
     this.dataGridTextBoxColumn3.FormatInfo  = null;
     this.dataGridTextBoxColumn3.HeaderText  = "Курс";
     this.dataGridTextBoxColumn3.MappingName = "CurrencyRate";
     this.dataGridTextBoxColumn3.NullText    = "-";
     this.dataGridTextBoxColumn3.Width       = 75;
     //
     // toolBar1
     //
     this.toolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
     this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
         this.toolBarButton1,
         this.toolBarButton2,
         this.toolBarButton4,
         this.toolBarButton3,
         this.toolBarButton5,
         this.tbbRate
     });
     this.toolBar1.ButtonSize     = new System.Drawing.Size(100, 22);
     this.toolBar1.DropDownArrows = true;
     this.toolBar1.ImageList      = this.imageList1;
     this.toolBar1.Location       = new System.Drawing.Point(0, 0);
     this.toolBar1.Name           = "toolBar1";
     this.toolBar1.ShowToolTips   = true;
     this.toolBar1.Size           = new System.Drawing.Size(340, 72);
     this.toolBar1.TabIndex       = 0;
     this.toolBar1.TextAlign      = System.Windows.Forms.ToolBarTextAlign.Right;
     this.toolBar1.ButtonClick   += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
     //
     // toolBarButton1
     //
     this.toolBarButton1.ImageIndex = 3;
     this.toolBarButton1.Text       = "Новый";
     //
     // toolBarButton2
     //
     this.toolBarButton2.ImageIndex = 0;
     this.toolBarButton2.Text       = "Изменить";
     //
     // toolBarButton4
     //
     this.toolBarButton4.ImageIndex = 1;
     this.toolBarButton4.Text       = "Удалить";
     //
     // toolBarButton3
     //
     this.toolBarButton3.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
     //
     // toolBarButton5
     //
     this.toolBarButton5.ImageIndex = 2;
     this.toolBarButton5.Text       = "Обновить";
     //
     // tbbRate
     //
     this.tbbRate.ImageIndex = 4;
     this.tbbRate.Text       = "Курс";
     //
     // imageList1
     //
     this.imageList1.ImageSize        = new System.Drawing.Size(16, 16);
     this.imageList1.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
     this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
     //
     // mainMenu1
     //
     this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.mnuEdit
     });
     //
     // mnuEdit
     //
     this.mnuEdit.Index = 0;
     this.mnuEdit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem2,
         this.menuItem3,
         this.menuItem4,
         this.menuItem5,
         this.menuItem6,
         this.menuItem1,
         this.mnuSetCurrencyRate
     });
     this.mnuEdit.Text = "Редактирование";
     //
     // menuItem2
     //
     this.menuItem2.Index    = 0;
     this.menuItem2.Shortcut = System.Windows.Forms.Shortcut.F3;
     this.menuItem2.Text     = "Новая";
     this.menuItem2.Click   += new System.EventHandler(this.menuItem2_Click);
     //
     // menuItem3
     //
     this.menuItem3.Index    = 1;
     this.menuItem3.Shortcut = System.Windows.Forms.Shortcut.F10;
     this.menuItem3.Text     = "Изменить";
     this.menuItem3.Click   += new System.EventHandler(this.menuItem3_Click);
     //
     // menuItem4
     //
     this.menuItem4.Index    = 2;
     this.menuItem4.Shortcut = System.Windows.Forms.Shortcut.CtrlDel;
     this.menuItem4.Text     = "Удалить";
     this.menuItem4.Click   += new System.EventHandler(this.menuItem4_Click);
     //
     // menuItem5
     //
     this.menuItem5.Index = 3;
     this.menuItem5.Text  = "-";
     //
     // menuItem6
     //
     this.menuItem6.Index    = 4;
     this.menuItem6.Shortcut = System.Windows.Forms.Shortcut.F5;
     this.menuItem6.Text     = "Обновить";
     this.menuItem6.Click   += new System.EventHandler(this.menuItem6_Click);
     //
     // menuItem1
     //
     this.menuItem1.Index = 5;
     this.menuItem1.Text  = "-";
     //
     // mnuSetCurrencyRate
     //
     this.mnuSetCurrencyRate.Index  = 6;
     this.mnuSetCurrencyRate.Text   = "Изменить Курс";
     this.mnuSetCurrencyRate.Click += new System.EventHandler(this.mnuSetCurrencyRate_Click);
     //
     // CurrList
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
     this.ClientSize        = new System.Drawing.Size(340, 247);
     this.Controls.Add(this.dataGrid1);
     this.Controls.Add(this.toolBar1);
     this.Font          = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Menu          = this.mainMenu1;
     this.Name          = "CurrList";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text          = "Валюты";
     this.Load         += new System.EventHandler(this.CurrList_Load);
     ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dataView1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsCurr1)).EndInit();
     this.ResumeLayout(false);
 }
Example #5
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlConnection1    = new System.Data.SqlClient.SqlConnection();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.dsDataSet         = new BPS.BLL.Currency.DataSets.dsCurr();
     this.sqlDataAdapter1   = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.daCurrHistory     = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand3 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand3 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand2 = new System.Data.SqlClient.SqlCommand();
     this.dsCurrHistory1    = new BPS.BLL.Currency.DataSets.dsCurrHistory();
     this.sqlCmdSetRate     = new System.Data.SqlClient.SqlCommand();
     ((System.ComponentModel.ISupportInitialize)(this.dsDataSet)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsCurrHistory1)).BeginInit();
     //
     // sqlConnection1
     //
     this.sqlConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("ConnectionString", typeof(string))));
     //
     // dsDataSet
     //
     this.dsDataSet.DataSetName = "dsCurr";
     this.dsDataSet.Locale      = new System.Globalization.CultureInfo("ru-RU");
     //
     // sqlDataAdapter1
     //
     this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand2;
     this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand2;
     this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
     this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Currencies", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("CurrencyID", "CurrencyID"),
             new System.Data.Common.DataColumnMapping("CurrencyName", "CurrencyName"),
             new System.Data.Common.DataColumnMapping("CurrencyRate", "CurrencyRate"),
             new System.Data.Common.DataColumnMapping("IsBase", "IsBase")
         })
     });
     this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
     //
     // sqlDeleteCommand2
     //
     this.sqlDeleteCommand2.CommandText = "DELETE FROM Currencies WHERE (CurrencyID = @Original_CurrencyID) AND (CurrencyNam" +
                                          "e = @Original_CurrencyName) AND (CurrencyRate = @Original_CurrencyRate) AND (IsB" +
                                          "ase = @Original_IsBase)";
     this.sqlDeleteCommand2.Connection = this.sqlConnection1;
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrencyID", System.Data.SqlDbType.NVarChar, 3, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrencyID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrencyName", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrencyName", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrencyRate", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrencyRate", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_IsBase", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "IsBase", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand2
     //
     this.sqlInsertCommand2.CommandText = "INSERT INTO Currencies(CurrencyID, CurrencyName, CurrencyRate, IsBase) VALUES (@C" +
                                          "urrencyID, @CurrencyName, @CurrencyRate, @IsBase); SELECT CurrencyID, CurrencyNa" +
                                          "me, CurrencyRate, IsBase FROM Currencies WHERE (CurrencyID = @CurrencyID)";
     this.sqlInsertCommand2.Connection = this.sqlConnection1;
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrencyID", System.Data.SqlDbType.NVarChar, 3, "CurrencyID"));
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrencyName", System.Data.SqlDbType.NVarChar, 50, "CurrencyName"));
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrencyRate", System.Data.SqlDbType.Float, 8, "CurrencyRate"));
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsBase", System.Data.SqlDbType.Bit, 1, "IsBase"));
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT CurrencyID, CurrencyName, CurrencyRate, IsBase FROM Currencies";
     this.sqlSelectCommand1.Connection  = this.sqlConnection1;
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = @"UPDATE Currencies SET CurrencyID = @CurrencyID, CurrencyName = @CurrencyName, CurrencyRate = @CurrencyRate, IsBase = @IsBase WHERE (CurrencyID = @Original_CurrencyID) AND (CurrencyName = @Original_CurrencyName) AND (CurrencyRate = @Original_CurrencyRate) AND (IsBase = @Original_IsBase); SELECT CurrencyID, CurrencyName, CurrencyRate, IsBase FROM Currencies WHERE (CurrencyID = @CurrencyID)";
     this.sqlUpdateCommand1.Connection  = this.sqlConnection1;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrencyID", System.Data.SqlDbType.NVarChar, 3, "CurrencyID"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrencyName", System.Data.SqlDbType.NVarChar, 50, "CurrencyName"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrencyRate", System.Data.SqlDbType.Float, 8, "CurrencyRate"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsBase", System.Data.SqlDbType.Bit, 1, "IsBase"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrencyID", System.Data.SqlDbType.NVarChar, 3, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrencyID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrencyName", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrencyName", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrencyRate", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrencyRate", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_IsBase", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "IsBase", System.Data.DataRowVersion.Original, null));
     //
     // daCurrHistory
     //
     this.daCurrHistory.DeleteCommand = this.sqlDeleteCommand3;
     this.daCurrHistory.InsertCommand = this.sqlInsertCommand3;
     this.daCurrHistory.SelectCommand = this.sqlSelectCommand2;
     this.daCurrHistory.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "CurrenciesHistory", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("CurrDate", "CurrDate"),
             new System.Data.Common.DataColumnMapping("CurrencyID", "CurrencyID"),
             new System.Data.Common.DataColumnMapping("CurrRate", "CurrRate"),
             new System.Data.Common.DataColumnMapping("BaseCurrencyID", "BaseCurrencyID")
         })
     });
     this.daCurrHistory.UpdateCommand = this.sqlUpdateCommand2;
     //
     // sqlDeleteCommand3
     //
     this.sqlDeleteCommand3.CommandText = "DELETE FROM CurrenciesHistory WHERE (ID = @Original_ID) AND (BaseCurrencyID = @Or" +
                                          "iginal_BaseCurrencyID) AND (CurrDate = @Original_CurrDate) AND (CurrRate = @Orig" +
                                          "inal_CurrRate) AND (CurrencyID = @Original_CurrencyID)";
     this.sqlDeleteCommand3.Connection = this.sqlConnection1;
     this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BaseCurrencyID", System.Data.SqlDbType.NVarChar, 3, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BaseCurrencyID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrDate", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrRate", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrRate", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrencyID", System.Data.SqlDbType.NVarChar, 3, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrencyID", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand3
     //
     this.sqlInsertCommand3.CommandText = "INSERT INTO CurrenciesHistory(CurrDate, CurrencyID, CurrRate, BaseCurrencyID) VAL" +
                                          "UES (@CurrDate, @CurrencyID, @CurrRate, @BaseCurrencyID); SELECT ID, CurrDate, C" +
                                          "urrencyID, CurrRate, BaseCurrencyID FROM CurrenciesHistory WHERE (ID = @@IDENTIT" +
                                          "Y)";
     this.sqlInsertCommand3.Connection = this.sqlConnection1;
     this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrDate", System.Data.SqlDbType.DateTime, 8, "CurrDate"));
     this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrencyID", System.Data.SqlDbType.NVarChar, 3, "CurrencyID"));
     this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrRate", System.Data.SqlDbType.Float, 8, "CurrRate"));
     this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BaseCurrencyID", System.Data.SqlDbType.NVarChar, 3, "BaseCurrencyID"));
     //
     // sqlSelectCommand2
     //
     this.sqlSelectCommand2.CommandText = @"SELECT CurrenciesHistory.ID, CurrenciesHistory.CurrDate, CurrenciesHistory.CurrencyID, CurrenciesHistory.CurrRate, CurrenciesHistory.BaseCurrencyID, Currencies.CurrencyName FROM CurrenciesHistory INNER JOIN Currencies ON CurrenciesHistory.CurrencyID = Currencies.CurrencyID";
     this.sqlSelectCommand2.Connection  = this.sqlConnection1;
     //
     // sqlUpdateCommand2
     //
     this.sqlUpdateCommand2.CommandText = @"UPDATE CurrenciesHistory SET CurrDate = @CurrDate, CurrencyID = @CurrencyID, CurrRate = @CurrRate, BaseCurrencyID = @BaseCurrencyID WHERE (ID = @Original_ID) AND (BaseCurrencyID = @Original_BaseCurrencyID) AND (CurrDate = @Original_CurrDate) AND (CurrRate = @Original_CurrRate) AND (CurrencyID = @Original_CurrencyID); SELECT ID, CurrDate, CurrencyID, CurrRate, BaseCurrencyID FROM CurrenciesHistory WHERE (ID = @ID)";
     this.sqlUpdateCommand2.Connection  = this.sqlConnection1;
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrDate", System.Data.SqlDbType.DateTime, 8, "CurrDate"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrencyID", System.Data.SqlDbType.NVarChar, 3, "CurrencyID"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CurrRate", System.Data.SqlDbType.Float, 8, "CurrRate"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BaseCurrencyID", System.Data.SqlDbType.NVarChar, 3, "BaseCurrencyID"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BaseCurrencyID", System.Data.SqlDbType.NVarChar, 3, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BaseCurrencyID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrDate", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrRate", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrRate", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CurrencyID", System.Data.SqlDbType.NVarChar, 3, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CurrencyID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     //
     // dsCurrHistory1
     //
     this.dsCurrHistory1.DataSetName = "dsCurrHistory";
     this.dsCurrHistory1.Locale      = new System.Globalization.CultureInfo("ru-RU");
     //
     // sqlCmdSetRate
     //
     this.sqlCmdSetRate.CommandText = "[CurrencyChangeRate]";
     this.sqlCmdSetRate.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlCmdSetRate.Connection  = this.sqlConnection1;
     this.sqlCmdSetRate.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(10)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     this.sqlCmdSetRate.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sCurrencyID", System.Data.SqlDbType.NVarChar, 3));
     this.sqlCmdSetRate.Parameters.Add(new System.Data.SqlClient.SqlParameter("@fRate", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(15)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     ((System.ComponentModel.ISupportInitialize)(this.dsDataSet)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsCurrHistory1)).EndInit();
 }
Example #6
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(EditCurr));
     this.tbCurrID   = new System.Windows.Forms.TextBox();
     this.dataView1  = new System.Data.DataView();
     this.dsCurr1    = new BPS.BLL.Currency.DataSets.dsCurr();
     this.tbCurrName = new System.Windows.Forms.TextBox();
     this.btnOK      = new System.Windows.Forms.Button();
     this.btnCancel  = new System.Windows.Forms.Button();
     this.label1     = new System.Windows.Forms.Label();
     this.label2     = new System.Windows.Forms.Label();
     this.label3     = new System.Windows.Forms.Label();
     this.tbvRate    = new AM_Controls.TextBoxV();
     ((System.ComponentModel.ISupportInitialize)(this.dataView1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsCurr1)).BeginInit();
     this.SuspendLayout();
     //
     // tbCurrID
     //
     this.tbCurrID.Font      = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.tbCurrID.Location  = new System.Drawing.Point(70, 0);
     this.tbCurrID.MaxLength = 3;
     this.tbCurrID.Name      = "tbCurrID";
     this.tbCurrID.Size      = new System.Drawing.Size(50, 21);
     this.tbCurrID.TabIndex  = 1;
     this.tbCurrID.Text      = "";
     //
     // dataView1
     //
     this.dataView1.Table = this.dsCurr1.Currencies;
     //
     // dsCurr1
     //
     this.dsCurr1.DataSetName = "dsCurr";
     this.dsCurr1.Locale      = new System.Globalization.CultureInfo("ru-RU");
     //
     // tbCurrName
     //
     this.tbCurrName.Font      = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.tbCurrName.Location  = new System.Drawing.Point(70, 22);
     this.tbCurrName.MaxLength = 50;
     this.tbCurrName.Name      = "tbCurrName";
     this.tbCurrName.Size      = new System.Drawing.Size(192, 21);
     this.tbCurrName.TabIndex  = 3;
     this.tbCurrName.Text      = "";
     //
     // btnOK
     //
     this.btnOK.Font     = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
     this.btnOK.Location = new System.Drawing.Point(100, 90);
     this.btnOK.Name     = "btnOK";
     this.btnOK.Size     = new System.Drawing.Size(80, 22);
     this.btnOK.TabIndex = 6;
     this.btnOK.Text     = "Сохранить";
     this.btnOK.Click   += new System.EventHandler(this.btnOK_Click);
     //
     // btnCancel
     //
     this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.btnCancel.Font         = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
     this.btnCancel.Location     = new System.Drawing.Point(182, 90);
     this.btnCancel.Name         = "btnCancel";
     this.btnCancel.Size         = new System.Drawing.Size(80, 22);
     this.btnCancel.TabIndex     = 7;
     this.btnCancel.Text         = "Отменить";
     //
     // label1
     //
     this.label1.Location  = new System.Drawing.Point(4, 3);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(64, 16);
     this.label1.TabIndex  = 0;
     this.label1.Text      = "Код:";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label2
     //
     this.label2.Location  = new System.Drawing.Point(4, 25);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(64, 16);
     this.label2.TabIndex  = 2;
     this.label2.Text      = "Название:";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label3
     //
     this.label3.Location  = new System.Drawing.Point(4, 48);
     this.label3.Name      = "label3";
     this.label3.Size      = new System.Drawing.Size(64, 16);
     this.label3.TabIndex  = 4;
     this.label3.Text      = "Курс:";
     this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // tbvRate
     //
     this.tbvRate.AllowDrop = true;
     this.tbvRate.dValue    = 0;
     this.tbvRate.IsPcnt    = false;
     this.tbvRate.Location  = new System.Drawing.Point(70, 44);
     this.tbvRate.MaxDecPos = 2;
     this.tbvRate.MaxPos    = 8;
     this.tbvRate.Name      = "tbvRate";
     this.tbvRate.nValue    = ((long)(0));
     this.tbvRate.TabIndex  = 5;
     this.tbvRate.Text      = "0";
     this.tbvRate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     this.tbvRate.TextMode  = false;
     //
     // EditCurr
     //
     this.AcceptButton      = this.btnOK;
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
     this.CancelButton      = this.btnCancel;
     this.ClientSize        = new System.Drawing.Size(268, 117);
     this.Controls.Add(this.tbvRate);
     this.Controls.Add(this.tbCurrID);
     this.Controls.Add(this.tbCurrName);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.btnOK);
     this.Controls.Add(this.btnCancel);
     this.Controls.Add(this.label3);
     this.Font            = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     this.Icon            = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox     = false;
     this.MinimizeBox     = false;
     this.Name            = "EditCurr";
     this.ShowInTaskbar   = false;
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text            = "Валюта";
     ((System.ComponentModel.ISupportInitialize)(this.dataView1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsCurr1)).EndInit();
     this.ResumeLayout(false);
 }