Beispiel #1
0
        //MEDHAT //ShareOnServer
        public static EStreetBoxPhuse ServerSelectByCode(int Code, SqlConnection ServerConnection, SqlTransaction ServerTransaction)
        {
            Editor        ed         = Application.DocumentManager.MdiActiveDocument.Editor;
            SqlConnection connection = ServerConnection;
            SqlCommand    command    = new SqlCommand("E_StreetBoxPhuse_SelectByCode", connection);

            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("iCode", Code));
            command.Transaction = ServerTransaction;

            SqlDataReader   reader = command.ExecuteReader();
            EStreetBoxPhuse sbp    = new EStreetBoxPhuse();

            if (reader.Read())
            {
                sbp.Code          = Convert.ToInt32(reader["Code"].ToString());
                sbp.StreetBoxCode = Convert.ToInt32(reader["StreetBoxCode"].ToString());
                sbp.XCode         = new Guid(reader["XCode"].ToString());
                sbp.FeederNum     = Convert.ToInt32(reader["FeederNum"].ToString());
                sbp.Comment       = reader["Comment"].ToString();
                sbp.PhuseType     = Convert.ToByte(reader["PhuseType"].ToString());
                sbp.IsDefault     = Convert.ToBoolean(reader["IsDefault"].ToString());

                sbp.PhuseCode = Convert.ToInt32(reader["PhuseCode"].ToString());
            }
            else
            {
                sbp.Code = -1;
                ed.WriteMessage("ServerSelectByCode found no row in : street box phuse\n");
            }
            reader.Close();
            return(sbp);
        }
Beispiel #2
0
        public static EStreetBoxPhuse SelectByCodeForLocal(int Code, SqlTransaction Transaction, SqlConnection Connection)
        {
            SqlConnection connection = Connection;// new SqlConnection(Atend.Control.ConnectionString.LocalcnString);
            SqlCommand    command    = new SqlCommand("E_StreetBoxPhuse_SelectByCode", connection);

            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("iCode", Code));
            command.Transaction = Transaction;
            //connection.Open();
            SqlDataReader   reader = command.ExecuteReader();
            EStreetBoxPhuse sbp    = new EStreetBoxPhuse();

            if (reader.Read())
            {
                sbp.Code           = Convert.ToInt32(reader["Code"].ToString());
                sbp.StreetBoxXCode = new Guid(reader["StreetBoxXCode"].ToString());
                sbp.XCode          = new Guid(reader["XCode"].ToString());
                sbp.FeederNum      = Convert.ToInt32(reader["FeederNum"].ToString());
                sbp.Comment        = reader["Comment"].ToString();
                sbp.PhuseType      = Convert.ToByte(reader["PhuseType"].ToString());
                sbp.IsDefault      = Convert.ToBoolean(reader["IsDefault"].ToString());

                sbp.PhuseXCode = new Guid(reader["PhuseXCode"].ToString());
            }
            else
            {
                sbp.Code = -1;
            }

            reader.Close();
            //connection.Close();

            return(sbp);
        }
Beispiel #3
0
        //ASHKTORAB
        public static EStreetBoxPhuse SelectByCode(int Code)
        {
            SqlConnection connection = new SqlConnection(Atend.Control.ConnectionString.ServercnString);
            SqlCommand    command    = new SqlCommand("E_StreetBoxPhuse_SelectByCode", connection);

            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("iCode", Code));
            connection.Open();
            SqlDataReader   reader = command.ExecuteReader();
            EStreetBoxPhuse sbp    = new EStreetBoxPhuse();

            if (reader.Read())
            {
                sbp.Code          = Convert.ToInt32(reader["Code"].ToString());
                sbp.StreetBoxCode = Convert.ToInt32(reader["StreetBoxCode"].ToString());
                sbp.FeederNum     = Convert.ToInt32(reader["FeederNum"].ToString());
                sbp.Comment       = reader["Comment"].ToString();
                sbp.PhuseType     = Convert.ToByte(reader["PhuseType"].ToString());
                sbp.PhuseCode     = Convert.ToInt32(reader["PhuseCode"].ToString());
            }
            reader.Close();
            connection.Close();

            return(sbp);
        }