コード例 #1
0
ファイル: OrganizationExt.cs プロジェクト: iucalyptus/fox
 public OrganizationExt(Organization org)
 {
     this.Adress = org.Adress;
     this.ID = org.ID;
     this.OrganizationDescription = org.OrganizationDescription;
     this.OrganizationName = org.OrganizationName;
     this.Phone = org.Phone;
     this.listJournal = null;
     this.listClients = null;
 }
コード例 #2
0
 private void btnAddClient_Click(object sender, EventArgs e)
 {
     int[] rowsSel=gridViewSearchClient.GetSelectedRows();
     if (rowsSel.Length == 1)
     {
         organization = (Organization)gridViewSearchClient.GetRow(rowsSel[0]);
         this.DialogResult = DialogResult.OK;
     }
     else
     {
         //выберите строку
     }
 }
コード例 #3
0
ファイル: EditOrganForm.cs プロジェクト: iucalyptus/fox
        public EditOrganForm(Organization organizationTo)
        {
            InitializeComponent();
            try
            {
                if (organizationTo != null)
                {

                   textEditAdress.Text = organizationTo.Adress;
                   textEditPhone.Text = organizationTo.Phone;
                   textEditName.Text = organizationTo.OrganizationName;
                   memoEditDescription.Text = organizationTo.OrganizationDescription;
                   organizationToAdd.ID = organizationTo.ID;

                }
            }
            catch (Exception ex)
            {

            }
        }
コード例 #4
0
ファイル: DataProvider.cs プロジェクト: iucalyptus/fox
        public static List<Organization> GetOrganizations()
        {
            List<Organization> orgList = new List<Organization>();
            try
            {
                SqlConnection connection = OpenConnection();
                if ((connection == null) || (connection.State == ConnectionState.Closed))
                    return null;

                SqlCommand ngCommand = connection.CreateCommand();
                ngCommand.CommandType = CommandType.StoredProcedure;
                ngCommand.CommandText = GET_ORGANIZATIONS_REGISRTY;
                // ngCommand.CommandTimeout = CommandTimeOut > 2 * connection.ConnectionTimeout ? CommandTimeOut : 2 * connection.ConnectionTimeout;

                ngCommand.ExecuteNonQuery();
                SqlDataReader reader = null;
                if (connection != null)
                {

                    reader = ngCommand.ExecuteReader();
                    while (reader.Read())
                    {
                        Organization newOrganization = new Organization();

                        newOrganization.OrganizationName = (string)reader["Name"];
                        newOrganization.ID = (int)reader["ID"];
                        newOrganization.OrganizationDescription = (string)reader["Description"];
                        newOrganization.Phone = (string)reader["Phone"];
                        newOrganization.Adress = (string)reader["Adress"];

                        orgList.Add(newOrganization);

                    }

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                CloseConnection();
                return null;
            }
            CloseConnection();
            return orgList;
        }